Java Code Examples for org.datavec.api.transform.ColumnType#Time

The following examples show how to use org.datavec.api.transform.ColumnType#Time . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OverlappingTimeWindowFunction.java    From DataVec with Apache License 2.0 6 votes vote down vote up
@Override
public void setInputSchema(Schema schema) {
    if (!(schema instanceof SequenceSchema))
        throw new IllegalArgumentException(
                        "Invalid schema: OverlappingTimeWindowFunction can only operate on SequenceSchema");
    if (!schema.hasColumn(timeColumn))
        throw new IllegalStateException("Input schema does not have a column with name \"" + timeColumn + "\"");

    if (schema.getMetaData(timeColumn).getColumnType() != ColumnType.Time)
        throw new IllegalStateException("Invalid column: column \"" + timeColumn + "\" is not of type "
                        + ColumnType.Time + "; is " + schema.getMetaData(timeColumn).getColumnType());

    this.inputSchema = schema;

    timeZone = ((TimeMetaData) schema.getMetaData(timeColumn)).getTimeZone();
}
 
Example 2
Source File: TimeWindowFunction.java    From DataVec with Apache License 2.0 6 votes vote down vote up
@Override
public void setInputSchema(Schema schema) {
    if (!(schema instanceof SequenceSchema))
        throw new IllegalArgumentException(
                        "Invalid schema: TimeWindowFunction can " + "only operate on SequenceSchema");
    if (!schema.hasColumn(timeColumn))
        throw new IllegalStateException("Input schema does not have a column with name \"" + timeColumn + "\"");

    if (schema.getMetaData(timeColumn).getColumnType() != ColumnType.Time)
        throw new IllegalStateException("Invalid column: column \"" + timeColumn + "\" is not of type "
                        + ColumnType.Time + "; is " + schema.getMetaData(timeColumn).getColumnType());

    this.inputSchema = schema;

    timeZone = ((TimeMetaData) schema.getMetaData(timeColumn)).getTimeZone();
}
 
Example 3
Source File: OverlappingTimeWindowFunction.java    From deeplearning4j with Apache License 2.0 6 votes vote down vote up
@Override
public void setInputSchema(Schema schema) {
    if (!(schema instanceof SequenceSchema))
        throw new IllegalArgumentException(
                        "Invalid schema: OverlappingTimeWindowFunction can only operate on SequenceSchema");
    if (!schema.hasColumn(timeColumn))
        throw new IllegalStateException("Input schema does not have a column with name \"" + timeColumn + "\"");

    if (schema.getMetaData(timeColumn).getColumnType() != ColumnType.Time)
        throw new IllegalStateException("Invalid column: column \"" + timeColumn + "\" is not of type "
                        + ColumnType.Time + "; is " + schema.getMetaData(timeColumn).getColumnType());

    this.inputSchema = schema;

    timeZone = ((TimeMetaData) schema.getMetaData(timeColumn)).getTimeZone();
}
 
Example 4
Source File: TimeWindowFunction.java    From deeplearning4j with Apache License 2.0 6 votes vote down vote up
@Override
public void setInputSchema(Schema schema) {
    if (!(schema instanceof SequenceSchema))
        throw new IllegalArgumentException(
                        "Invalid schema: TimeWindowFunction can " + "only operate on SequenceSchema");
    if (!schema.hasColumn(timeColumn))
        throw new IllegalStateException("Input schema does not have a column with name \"" + timeColumn + "\"");

    if (schema.getMetaData(timeColumn).getColumnType() != ColumnType.Time)
        throw new IllegalStateException("Invalid column: column \"" + timeColumn + "\" is not of type "
                        + ColumnType.Time + "; is " + schema.getMetaData(timeColumn).getColumnType());

    this.inputSchema = schema;

    timeZone = ((TimeMetaData) schema.getMetaData(timeColumn)).getTimeZone();
}
 
Example 5
Source File: SequenceSplitTimeSeparation.java    From DataVec with Apache License 2.0 5 votes vote down vote up
@Override
public void setInputSchema(Schema inputSchema) {
    if (!inputSchema.hasColumn(timeColumn))
        throw new IllegalStateException(
                        "Invalid state: schema does not have column " + "with name \"" + timeColumn + "\"");
    if (inputSchema.getMetaData(timeColumn).getColumnType() != ColumnType.Time) {
        throw new IllegalStateException("Invalid input schema: schema column \"" + timeColumn
                        + "\" is not a time column." + " (Is type: "
                        + inputSchema.getMetaData(timeColumn).getColumnType() + ")");
    }

    this.timeColumnIdx = inputSchema.getIndexOfColumn(timeColumn);
    this.schema = inputSchema;
}
 
Example 6
Source File: SequenceSplitTimeSeparation.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Override
public void setInputSchema(Schema inputSchema) {
    if (!inputSchema.hasColumn(timeColumn))
        throw new IllegalStateException(
                        "Invalid state: schema does not have column " + "with name \"" + timeColumn + "\"");
    if (inputSchema.getMetaData(timeColumn).getColumnType() != ColumnType.Time) {
        throw new IllegalStateException("Invalid input schema: schema column \"" + timeColumn
                        + "\" is not a time column." + " (Is type: "
                        + inputSchema.getMetaData(timeColumn).getColumnType() + ")");
    }

    this.timeColumnIdx = inputSchema.getIndexOfColumn(timeColumn);
    this.schema = inputSchema;
}
 
Example 7
Source File: TimeMetaData.java    From DataVec with Apache License 2.0 4 votes vote down vote up
@Override
public ColumnType getColumnType() {
    return ColumnType.Time;
}
 
Example 8
Source File: TimeMetaData.java    From deeplearning4j with Apache License 2.0 4 votes vote down vote up
@Override
public ColumnType getColumnType() {
    return ColumnType.Time;
}