mirror of
https://github.com/twitter/the-algorithm.git
synced 2025-01-03 08:01:53 +01:00
Compare commits
2 Commits
281c33ac0c
...
253938648e
Author | SHA1 | Date | |
---|---|---|---|
|
253938648e | ||
|
ae697c3e4f |
@ -65,13 +65,12 @@ public class StringMapBasedLinearModel implements MapBasedLinearModel<String> {
|
||||
public float score(Map<String, Float> values) {
|
||||
float score = 0.0f;
|
||||
for (Map.Entry<String, Float> 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()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user