diff --git a/src/java/com/twitter/search/common/util/ml/StringMapBasedLinearModel.java b/src/java/com/twitter/search/common/util/ml/StringMapBasedLinearModel.java index cc0686ef4..8bcbbcdc9 100644 --- a/src/java/com/twitter/search/common/util/ml/StringMapBasedLinearModel.java +++ b/src/java/com/twitter/search/common/util/ml/StringMapBasedLinearModel.java @@ -65,13 +65,12 @@ public class StringMapBasedLinearModel implements MapBasedLinearModel { public float score(Map values) { float score = 0.0f; for (Map.Entry value : values.entrySet()) { - String featureName = value.getKey(); - float weight = getWeight(featureName); + float weight = getWeight(value.getKey()); if (weight != 0.0f) { score += weight * value.getValue(); if (LOG.isDebugEnabled()) { LOG.debug(String.format("%s = %.3f * %.3f = %.3f, ", - featureName, weight, value.getValue(), + value.getKey(), weight, value.getValue(), weight * value.getValue())); } }