Search in sources :

Example 1 with VectorAssembler

use of org.apache.spark.ml.feature.VectorAssembler in project jpmml-sparkml by jpmml.

the class VectorAssemblerConverter method encodeFeatures.

@Override
public List<Feature> encodeFeatures(SparkMLEncoder encoder) {
    VectorAssembler transformer = getTransformer();
    List<Feature> result = new ArrayList<>();
    String[] inputCols = transformer.getInputCols();
    for (String inputCol : inputCols) {
        List<Feature> features = encoder.getFeatures(inputCol);
        result.addAll(features);
    }
    return result;
}
Also used : VectorAssembler(org.apache.spark.ml.feature.VectorAssembler) ArrayList(java.util.ArrayList) Feature(org.jpmml.converter.Feature)

Aggregations

ArrayList (java.util.ArrayList)1 VectorAssembler (org.apache.spark.ml.feature.VectorAssembler)1 Feature (org.jpmml.converter.Feature)1