use of org.jpmml.converter.WildcardFeature in project jpmml-sparkml by jpmml.
the class SparkMLEncoder method getFeatures.
public List<Feature> getFeatures(String column) {
List<Feature> features = this.columnFeatures.get(column);
if (features == null) {
FieldName name = FieldName.create(column);
DataField dataField = getDataField(name);
if (dataField == null) {
dataField = createDataField(name);
}
Feature feature;
DataType dataType = dataField.getDataType();
switch(dataType) {
case STRING:
feature = new WildcardFeature(this, dataField);
break;
case INTEGER:
case DOUBLE:
feature = new ContinuousFeature(this, dataField);
break;
case BOOLEAN:
feature = new BooleanFeature(this, dataField);
break;
default:
throw new IllegalArgumentException("Data type " + dataType + " is not supported");
}
return Collections.singletonList(feature);
}
return features;
}
Aggregations