Class SequenceMovingWindowReduceTransform
- java.lang.Object
-
- org.datavec.api.transform.transform.sequence.SequenceMovingWindowReduceTransform
-
public class SequenceMovingWindowReduceTransform extends Object implements Transform
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSequenceMovingWindowReduceTransform.EdgeCaseHandlingEnumeration to specify how each cases are handled: For example, for a look back period of 20, how should the first 19 output values be calculated?
Default: Perform your former reduction as normal, with as many values are available
SpecifiedValue: use the given/specified value instead of the actual output value.
-
Constructor Summary
Constructors Constructor Description SequenceMovingWindowReduceTransform(String columnName, int lookback, ReduceOp op)SequenceMovingWindowReduceTransform(String columnName, String newColumnName, int lookback, ReduceOp op, SequenceMovingWindowReduceTransform.EdgeCaseHandling edgeCaseHandling, Writable edgeCaseValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcolumnName()Returns a singular column name this op is meant to run onString[]columnNames()Returns column names this op is meant to run onstatic StringdefaultOutputColumnName(String originalName, int lookback, ReduceOp op)SchemagetInputSchema()Getter for input schemaObjectmap(Object input)Transform an object in to another objectList<Writable>map(List<Writable> writables)Transform a writable in to another writableObjectmapSequence(Object sequence)Transform a sequenceList<List<Writable>>mapSequence(List<List<Writable>> sequence)Transform a sequenceStringoutputColumnName()The output column name after the operation has been appliedString[]outputColumnNames()The output column names This will often be the same as the inputvoidsetInputSchema(Schema inputSchema)Set the input schema.StringtoString()Schematransform(Schema inputSchema)
-
-
-
Constructor Detail
-
SequenceMovingWindowReduceTransform
public SequenceMovingWindowReduceTransform(String columnName, int lookback, ReduceOp op)
- Parameters:
columnName- Column name to perform windowing onlookback- Look back period for windowingop- Reduction operation to perform on each window
-
SequenceMovingWindowReduceTransform
public SequenceMovingWindowReduceTransform(String columnName, String newColumnName, int lookback, ReduceOp op, SequenceMovingWindowReduceTransform.EdgeCaseHandling edgeCaseHandling, Writable edgeCaseValue)
- Parameters:
columnName- Column name to perform windowing onnewColumnName- Name of the new output column (with results)lookback- Look back period for windowingop- Reduction operation to perform on each windowedgeCaseHandling- How the 1st steps should be handled (positions in sequence with indices less then the look-back period)edgeCaseValue- Used only with EdgeCaseHandling.SpecifiedValue, maybe null otherwise
-
-
Method Detail
-
defaultOutputColumnName
public static String defaultOutputColumnName(String originalName, int lookback, ReduceOp op)
-
setInputSchema
public void setInputSchema(Schema inputSchema)
Description copied from interface:ColumnOpSet the input schema.- Specified by:
setInputSchemain interfaceColumnOp
-
getInputSchema
public Schema getInputSchema()
Description copied from interface:ColumnOpGetter for input schema- Specified by:
getInputSchemain interfaceColumnOp- Returns:
-
map
public List<Writable> map(List<Writable> writables)
Description copied from interface:TransformTransform a writable in to another writable
-
mapSequence
public List<List<Writable>> mapSequence(List<List<Writable>> sequence)
Description copied from interface:TransformTransform a sequence- Specified by:
mapSequencein interfaceTransform
-
mapSequence
public Object mapSequence(Object sequence)
Transform a sequence- Specified by:
mapSequencein interfaceTransform- Parameters:
sequence-
-
outputColumnName
public String outputColumnName()
The output column name after the operation has been applied- Specified by:
outputColumnNamein interfaceColumnOp- Returns:
- the output column name
-
outputColumnNames
public String[] outputColumnNames()
The output column names This will often be the same as the input- Specified by:
outputColumnNamesin interfaceColumnOp- Returns:
- the output column names
-
columnNames
public String[] columnNames()
Returns column names this op is meant to run on- Specified by:
columnNamesin interfaceColumnOp- Returns:
-
columnName
public String columnName()
Returns a singular column name this op is meant to run on- Specified by:
columnNamein interfaceColumnOp- Returns:
-
-