From ae697c3e4fc84ca4f2d91452abd8d4dced33c08a Mon Sep 17 00:00:00 2001 From: lgon070 Date: Sat, 1 Apr 2023 22:38:22 -0500 Subject: [PATCH] too many featureName variables --- .../search/common/util/ml/StringMapBasedLinearModel.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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())); } }