public class TableRecords
extends java.lang.Object
Constructor and Description |
---|
TableRecords() |
Modifier and Type | Method and Description |
---|---|
static org.nd4j.linalg.api.ndarray.INDArray |
arrayFromTable(Table table)
Create a matrix from a table where
the matrix will be of n rows x m columns
|
static Column[] |
columnsForSchema(Schema schema)
Extract a column array from the given schema
|
static java.lang.Object |
determineInput(int row,
Column... inputColumns)
Determine the input type based on the column metadata
|
static java.util.List<java.util.List<Writable>> |
executeNonTimeSeries(java.util.List<java.util.List<Writable>> inputWritables,
TransformProcess transformProcess)
Execute the specified TransformProcess with the given input data
Note: this method can only be used if the TransformProcess returns non-sequence data. |
static Table |
filterTable(Table toFilter,
Filter filter)
Implements a filter
|
static Table |
fromRecordsAndSchema(java.util.List<java.util.List<Writable>> writable,
Schema schema)
Create a table from records and
a given schema.
|
static java.util.List<java.util.List<Writable>> |
fromTable(Table table)
Convert an all numeric table
to a list of records
|
static java.lang.Object |
getEntry(Column column,
int row)
Get an entry from the given column
|
static Filter |
mapFilterFromCondition(Condition condition,
java.lang.String columnName,
Schema output)
Map a condition
based on an input column
and an output schema
to a data frame filter
|
static Filter |
mapToFilter(Filter toMap)
Map a given filter
to a dataframe filter
|
static Table |
reduce(Table reduce,
Reducer reducer)
Run a reduce operation on the given table
|
static void |
setEntry(Column column,
int row,
java.lang.Object value)
Get an entry from the given column
|
static void |
setEntryList(Column[] columns,
int row,
java.lang.Object value)
Set an entry from the given columns
|
static Table |
sortedRank(Table toRank,
CalculateSortedRank rank) |
static Table |
tableFromSchema(Schema schema)
Create a table from the given schema
|
static Table |
transformNonTimeSeries(Table table,
TransformProcess transformProcess)
Apply a transformNonTimeSeries process
to the given table
|
static Table |
transformTable(Table table,
Transform transform)
Run a transformNonTimeSeries operation on the table
|
public static java.util.List<java.util.List<Writable>> executeNonTimeSeries(java.util.List<java.util.List<Writable>> inputWritables, TransformProcess transformProcess)
#executeToSequence(JavaRDD, TransformProcess)
inputWritables
- Input data to processtransformProcess
- TransformProcess to executeNonTimeSeriespublic static Table transformNonTimeSeries(Table table, TransformProcess transformProcess)
table
- the table to apply this totransformProcess
- the transformNonTimeSeries
process to applypublic static Table reduce(Table reduce, Reducer reducer)
reduce
- the reduce operation to runreducer
- the reducer to runpublic static Table sortedRank(Table toRank, CalculateSortedRank rank)
toRank
- rank
- public static Filter mapFilterFromCondition(Condition condition, java.lang.String columnName, Schema output)
condition
- the condition to mapcolumnName
- the input column name to mapoutput
- the output schema to infer the typepublic static Filter mapToFilter(Filter toMap)
toMap
- the filter to mapFilter
mapping from the datavec apipublic static Table filterTable(Table toFilter, Filter filter)
toFilter
- filter
- public static Table transformTable(Table table, Transform transform)
table
- the table to run the transformNonTimeSeries operation ontransform
- the transformNonTimeSeries to runpublic static java.lang.Object determineInput(int row, Column... inputColumns)
row
- the row of the column to get the input forinputColumns
- the input columns to get input forpublic static void setEntryList(Column[] columns, int row, java.lang.Object value)
columns
- the columns to set the entry forrow
- the row to get the entry fromvalue
- an object of type List
public static void setEntry(Column column, int row, java.lang.Object value)
column
- the column to get the entry fromrow
- the row to get the entry fromvalue
- the value to setpublic static java.lang.Object getEntry(Column column, int row)
column
- the column to get the entry fromrow
- the row to get the entry frompublic static org.nd4j.linalg.api.ndarray.INDArray arrayFromTable(Table table)
table
- the table to createpublic static java.util.List<java.util.List<Writable>> fromTable(Table table)
table
- the table to convertpublic static Table fromRecordsAndSchema(java.util.List<java.util.List<Writable>> writable, Schema schema)
NDArrayWritable
to represent columns.
The given ndarray must be a row of 1 x m where m
is schema.numColumns()writable
- the records to create the table fromschema
- the schema to usepublic static Table tableFromSchema(Schema schema)
schema
- the schema to create the table from