Search in sources :

Example 1 with HasDerivedName

use of org.jpmml.converter.HasDerivedName in project jpmml-r by jpmml.

the class Formula method getCoefficient.

public Double getCoefficient(Feature feature, RDoubleVector coefficients) {
    FieldName name = feature.getName();
    if (feature instanceof HasDerivedName) {
        BiMap<Feature, FieldName> inverseFeatures = this.features.inverse();
        name = inverseFeatures.get(feature);
    }
    return coefficients.getValue(name.getValue());
}
Also used : FieldName(org.dmg.pmml.FieldName) Feature(org.jpmml.converter.Feature) PowerFeature(org.jpmml.converter.PowerFeature) BinaryFeature(org.jpmml.converter.BinaryFeature) ContinuousFeature(org.jpmml.converter.ContinuousFeature) BooleanFeature(org.jpmml.converter.BooleanFeature) InteractionFeature(org.jpmml.converter.InteractionFeature) CategoricalFeature(org.jpmml.converter.CategoricalFeature) HasDerivedName(org.jpmml.converter.HasDerivedName)

Aggregations

FieldName (org.dmg.pmml.FieldName)1 BinaryFeature (org.jpmml.converter.BinaryFeature)1 BooleanFeature (org.jpmml.converter.BooleanFeature)1 CategoricalFeature (org.jpmml.converter.CategoricalFeature)1 ContinuousFeature (org.jpmml.converter.ContinuousFeature)1 Feature (org.jpmml.converter.Feature)1 HasDerivedName (org.jpmml.converter.HasDerivedName)1 InteractionFeature (org.jpmml.converter.InteractionFeature)1 PowerFeature (org.jpmml.converter.PowerFeature)1