public class ColumnFeatureFunction extends FeatureFunction
Constructor and Description |
---|
ColumnFeatureFunction(int[] featurePositions,
FeatureValueMapper[] valueMappers,
int labelColumnPos,
int numFeatures,
double defaultLabel)
Feature positions and value mappers are parallel arrays.
|
Modifier and Type | Method and Description |
---|---|
org.apache.spark.mllib.regression.LabeledPoint |
call(scala.Tuple2<org.apache.hadoop.io.WritableComparable,org.apache.hive.hcatalog.data.HCatRecord> tuple) |
public ColumnFeatureFunction(int[] featurePositions, FeatureValueMapper[] valueMappers, int labelColumnPos, int numFeatures, double defaultLabel)
featurePositions
- position number of feature column in the HCatRecordvalueMappers
- mapper for each column positionlabelColumnPos
- position of the label columnnumFeatures
- number of features in the feature vectordefaultLabel
- default lable to be used for null recordspublic org.apache.spark.mllib.regression.LabeledPoint call(scala.Tuple2<org.apache.hadoop.io.WritableComparable,org.apache.hive.hcatalog.data.HCatRecord> tuple) throws Exception
call
in interface org.apache.spark.api.java.function.Function<scala.Tuple2<org.apache.hadoop.io.WritableComparable,org.apache.hive.hcatalog.data.HCatRecord>,org.apache.spark.mllib.regression.LabeledPoint>
call
in class FeatureFunction
Exception
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.