public class SequenceDifferenceTransform extends Object implements Transform
SequenceDifferenceTransform.FirstStepMode enumeration provides the following ways of handling
these time steps:
Note: this is an in-place operation: i.e., the values in each column are modified. If the original values are
to be retained in the data set, first make a copy (for example, using TransformProcess.Builder.duplicateColumn(String, String))
and apply the difference operation in-place on the copy.
| Modifier and Type | Class and Description |
|---|---|
static class |
SequenceDifferenceTransform.FirstStepMode |
| Constructor and Description |
|---|
SequenceDifferenceTransform(String columnName)
Create a SequenceDifferenceTransform with default lookback of 1, and using FirstStepMode.Default.
|
SequenceDifferenceTransform(String columnName,
String newColumnName,
int lookback)
Create a SequenceDifferenceTransform with default lookback of 1, and using FirstStepMode.Default,
where the output column name is specified
|
SequenceDifferenceTransform(String columnName,
String newColumnName,
int lookback,
SequenceDifferenceTransform.FirstStepMode firstStepMode,
Writable specifiedValueWritable)
Create a SequenceDifferenceTransform with default lookback of 1, and using FirstStepMode.Default,
where the output column name is specified
|
| Modifier and Type | Method and Description |
|---|---|
String |
columnName()
Returns a singular column name
this op is meant to run on
|
String[] |
columnNames()
Returns column names
this op is meant to run on
|
Schema |
getInputSchema()
Getter for input schema
|
List<Writable> |
map(List<Writable> writables)
Transform a writable
in to another writable
|
Object |
map(Object input)
Transform an object
in to another object
|
List<List<Writable>> |
mapSequence(List<List<Writable>> sequence)
Transform a sequence
|
Object |
mapSequence(Object sequence)
Transform a sequence
|
String |
outputColumnName()
The output column name
after the operation has been applied
|
String[] |
outputColumnNames()
The output column names
This will often be the same as the input
|
void |
setInputSchema(Schema inputSchema)
Set the input schema.
|
Schema |
transform(Schema inputSchema)
Get the output schema for this transformation, given an input schema
|
public SequenceDifferenceTransform(String columnName)
columnName - Name of the column to perform the operation on.public SequenceDifferenceTransform(String columnName, String newColumnName, int lookback)
columnName - Name of the column to perform the operation on.newColumnName - New name for the column. May be same as the origina lcolumn namelookback - Lookback period, in number of time steps. Must be > 0public SequenceDifferenceTransform(String columnName, String newColumnName, int lookback, SequenceDifferenceTransform.FirstStepMode firstStepMode, Writable specifiedValueWritable)
columnName - Name of the column to perform the operation on.newColumnName - New name for the column. May be same as the origina lcolumn namelookback - Lookback period, in number of time steps. Must be > 0firstStepMode - see SequenceDifferenceTransform.FirstStepModespecifiedValueWritable - Must be null if using FirstStepMode.Default, or non-null if using FirstStepMode.SpecifiedValuepublic String outputColumnName()
outputColumnName in interface ColumnOppublic String[] outputColumnNames()
outputColumnNames in interface ColumnOppublic String[] columnNames()
columnNames in interface ColumnOppublic String columnName()
columnName in interface ColumnOppublic Schema transform(Schema inputSchema)
ColumnOppublic void setInputSchema(Schema inputSchema)
ColumnOpsetInputSchema in interface ColumnOppublic Schema getInputSchema()
ColumnOpgetInputSchema in interface ColumnOppublic List<Writable> map(List<Writable> writables)
Transformpublic List<List<Writable>> mapSequence(List<List<Writable>> sequence)
TransformmapSequence in interface Transformpublic Object mapSequence(Object sequence)
mapSequence in interface Transformsequence - Copyright © 2017. All rights reserved.