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 classGeographicMidpointReduction.AverageCoordinateReduceOp
-
Field Summary
Fields Modifier and Type Field Description static doubleEDGE_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 StringcolumnName()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)"SchemagetInputSchema()Getter for input schemaStringoutputColumnName()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.voidsetInputSchema(Schema inputSchema)Set the input schema.Schematransform(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:AggregableColumnReductionReduce 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:
reduceOpin interfaceAggregableColumnReduction- Returns:
- Writable containing the reduced data
-
getColumnsOutputName
public List<String> getColumnsOutputName(String columnInputName)
Description copied from interface:AggregableColumnReductionPost-reduce: what is the name of the column? For example, "myColumn" -> "mean(myColumn)"- Specified by:
getColumnsOutputNamein 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:AggregableColumnReductionPost-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:
getColumnOutputMetaDatain interfaceAggregableColumnReductioncolumnInputMeta- Metadata for the column, before reduce- Returns:
- Metadata for the column, after the reduction
-
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:
-
outputColumnName
public String outputColumnName()
Description copied from interface:ColumnOpThe output column name after the operation has been applied- Specified by:
outputColumnNamein interfaceColumnOp- Returns:
- the output column name
-
outputColumnNames
public String[] outputColumnNames()
Description copied from interface:ColumnOpThe 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()
Description copied from interface:ColumnOpReturns column names this op is meant to run on- Specified by:
columnNamesin interfaceColumnOp- Returns:
-
columnName
public String columnName()
Description copied from interface:ColumnOpReturns a singular column name this op is meant to run on- Specified by:
columnNamein interfaceColumnOp- Returns:
-
-