use of com.airbnb.aerosolve.core.function.Function in project aerosolve by airbnb.
the class AdditiveModel method scoreDenseFeatures.
public float scoreDenseFeatures(Map<String, List<Double>> denseFeatures) {
float sum = 0;
if (denseFeatures != null && !denseFeatures.isEmpty()) {
Map<String, Function> denseWeights = getOrCreateDenseWeights();
for (Map.Entry<String, List<Double>> feature : denseFeatures.entrySet()) {
String featureName = feature.getKey();
Function fun = denseWeights.get(featureName);
if (fun == null)
continue;
sum += fun.evaluate(toFloat(feature.getValue()));
}
}
return sum;
}
Aggregations