public class TransformProcess extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
TransformProcess.Builder
Builder class for constructing a TransformProcess
|
Constructor and Description |
---|
TransformProcess(Schema initialSchema,
List<DataAction> actionList) |
Modifier and Type | Method and Description |
---|---|
List<Writable> |
execute(List<Writable> input)
Execute the full sequence of transformations for a single example.
|
List<List<Writable>> |
executeSequence(List<List<Writable>> inputSequence)
Execute the full sequence of transformations for a single time series (sequence).
|
List<List<Writable>> |
executeSequenceToSequence(List<List<Writable>> input) |
List<Writable> |
executeSequenceToSingle(List<List<Writable>> inputSequence)
Execute a TransformProcess that starts with a sequence
record, and converts it to a single (non-sequence) record
|
List<List<Writable>> |
executeToSequence(List<Writable> inputExample)
Execute a TransformProcess that starts with a single (non-sequence) record,
and converts it to a sequence record.
|
List<List<List<Writable>>> |
executeToSequenceBatch(List<List<Writable>> inputExample)
Execute a TransformProcess that starts with a single (non-sequence) record,
and converts it to a sequence record.
|
static TransformProcess |
fromJson(String json)
Deserialize a JSON String (created by
toJson() ) to a TransformProcess |
static TransformProcess |
fromYaml(String yaml)
Deserialize a JSON String (created by
toJson() ) to a TransformProcess |
List<DataAction> |
getActionList()
Get the action list that this transform process
will execute
|
Schema |
getFinalSchema()
Get the Schema of the output data, after executing the process
|
Schema |
getSchemaAfterStep(int step)
Return the schema after executing all steps up to and including the specified step.
|
static List<String> |
inferCategories(RecordReader recordReader,
int columnIndex)
Infer the categories for the given record reader for a particular column
Note that each "column index" is a column in the context of:
List
|
static Map<Integer,List<String>> |
inferCategories(RecordReader recordReader,
int[] columnIndices)
Infer the categories for the given record reader for
a particular set of columns (this is more efficient than
inferCategories(RecordReader, int)
if you have more than one column you plan on inferring categories for)
Note that each "column index" is a column in the context of:
List |
String |
toJson()
Convert the TransformProcess to a JSON string
|
String |
toYaml()
Convert the TransformProcess to a YAML string
|
List<Writable> |
transformRawStringsToInput(String... values)
Based on the input schema,
map raw string values to the appropriate
writable
|
List<Writable> |
transformRawStringsToInputList(List<String> values)
Based on the input schema,
map raw string values to the appropriate
writable
|
List<List<Writable>> |
transformRawStringsToInputSequence(List<List<String>> sequence)
Transforms a sequence
of strings in to a sequence of writables
(very similar to
transformRawStringsToInput(String...)
for sequences |
public TransformProcess(Schema initialSchema, List<DataAction> actionList)
public List<DataAction> getActionList()
public Schema getFinalSchema()
public Schema getSchemaAfterStep(int step)
step
- Index of the steppublic List<Writable> execute(List<Writable> input)
input
- public List<List<Writable>> executeSequenceToSequence(List<List<Writable>> input)
input
- public List<List<Writable>> executeSequence(List<List<Writable>> inputSequence)
public List<List<List<Writable>>> executeToSequenceBatch(List<List<Writable>> inputExample)
ConvertToSequence
for details.inputExample
- Input examplepublic List<List<Writable>> executeToSequence(List<Writable> inputExample)
ConvertToSequence
for details.inputExample
- Input examplepublic List<Writable> executeSequenceToSingle(List<List<Writable>> inputSequence)
inputSequence
- Input sequencepublic String toJson()
public String toYaml()
public static TransformProcess fromJson(String json)
toJson()
) to a TransformProcesspublic static TransformProcess fromYaml(String yaml)
toJson()
) to a TransformProcesspublic static List<String> inferCategories(RecordReader recordReader, int columnIndex)
recordReader
- the record reader to iterate throughcolumnIndex
- te column index to get categories forpublic static Map<Integer,List<String>> inferCategories(RecordReader recordReader, int[] columnIndices)
inferCategories(RecordReader, int)
if you have more than one column you plan on inferring categories for)
Note that each "column index" is a column in the context of:
ListrecordReader
- the record reader to scancolumnIndices
- the column indices the getpublic List<List<Writable>> transformRawStringsToInputSequence(List<List<String>> sequence)
transformRawStringsToInput(String...)
for sequencessequence
- the sequence to transformpublic List<Writable> transformRawStringsToInputList(List<String> values)
values
- the values to convertCopyright © 2022. All rights reserved.