Class GeographicMidpointReduction
- java.lang.Object
-
- org.datavec.api.transform.reduce.impl.GeographicMidpointReduction
-
- All Implemented Interfaces:
Serializable
,ColumnOp
,Operation<Schema,Schema>
,AggregableColumnReduction
public class GeographicMidpointReduction extends Object implements AggregableColumnReduction
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeographicMidpointReduction.AverageCoordinateReduceOp
-
Field Summary
Fields Modifier and Type Field Description static double
EDGE_CASE_EPS
-
Constructor Summary
Constructors Constructor Description GeographicMidpointReduction(String delim)
GeographicMidpointReduction(String delim, String newColumnName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
columnName()
Returns a singular column name this op is meant to run onString[]
columnNames()
Returns column names this op is meant to run onList<ColumnMetaData>
getColumnOutputMetaData(List<String> newColumnName, ColumnMetaData columnInputMeta)
Post-reduce: what is the metadata (type, etc) for this column? For example: a "count unique" operation on a String (StringMetaData) column would return an Integer (IntegerMetaData) columnList<String>
getColumnsOutputName(String columnInputName)
Post-reduce: what is the name of the column? For example, "myColumn" -> "mean(myColumn)"Schema
getInputSchema()
Getter for input schemaString
outputColumnName()
The output column name after the operation has been appliedString[]
outputColumnNames()
The output column names This will often be the same as the inputIAggregableReduceOp<Writable,List<Writable>>
reduceOp()
Reduce a single column.void
setInputSchema(Schema inputSchema)
Set the input schema.Schema
transform(Schema inputSchema)
-
-
-
Field Detail
-
EDGE_CASE_EPS
public static final double EDGE_CASE_EPS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GeographicMidpointReduction
public GeographicMidpointReduction(String delim)
- Parameters:
delim
- Delimiter for the coordinates in text format. For example, if format is "lat,long" use ","
-
-
Method Detail
-
reduceOp
public IAggregableReduceOp<Writable,List<Writable>> reduceOp()
Description copied from interface:AggregableColumnReduction
Reduce a single column. Note: TheList<Writable>
here is a single column in a reduction window, and NOT the single row (as is usually the case forList<Writable>
instances- Specified by:
reduceOp
in interfaceAggregableColumnReduction
- Returns:
- Writable containing the reduced data
-
getColumnsOutputName
public List<String> getColumnsOutputName(String columnInputName)
Description copied from interface:AggregableColumnReduction
Post-reduce: what is the name of the column? For example, "myColumn" -> "mean(myColumn)"- Specified by:
getColumnsOutputName
in interfaceAggregableColumnReduction
- Parameters:
columnInputName
- Name of the column before reduction- Returns:
- Name of the column after the reduction
-
getColumnOutputMetaData
public List<ColumnMetaData> getColumnOutputMetaData(List<String> newColumnName, ColumnMetaData columnInputMeta)
Description copied from interface:AggregableColumnReduction
Post-reduce: what is the metadata (type, etc) for this column? For example: a "count unique" operation on a String (StringMetaData) column would return an Integer (IntegerMetaData) column- Specified by:
getColumnOutputMetaData
in interfaceAggregableColumnReduction
columnInputMeta
- Metadata for the column, before reduce- Returns:
- Metadata for the column, after the reduction
-
setInputSchema
public void setInputSchema(Schema inputSchema)
Description copied from interface:ColumnOp
Set the input schema.- Specified by:
setInputSchema
in interfaceColumnOp
-
getInputSchema
public Schema getInputSchema()
Description copied from interface:ColumnOp
Getter for input schema- Specified by:
getInputSchema
in interfaceColumnOp
- Returns:
-
outputColumnName
public String outputColumnName()
Description copied from interface:ColumnOp
The output column name after the operation has been applied- Specified by:
outputColumnName
in interfaceColumnOp
- Returns:
- the output column name
-
outputColumnNames
public String[] outputColumnNames()
Description copied from interface:ColumnOp
The output column names This will often be the same as the input- Specified by:
outputColumnNames
in interfaceColumnOp
- Returns:
- the output column names
-
columnNames
public String[] columnNames()
Description copied from interface:ColumnOp
Returns column names this op is meant to run on- Specified by:
columnNames
in interfaceColumnOp
- Returns:
-
columnName
public String columnName()
Description copied from interface:ColumnOp
Returns a singular column name this op is meant to run on- Specified by:
columnName
in interfaceColumnOp
- Returns:
-
-