Browse files

Fixed score calculation w.r.t bias values in predict()

  • Loading branch information...
1 parent 06d6239 commit f895269e5327fa8165687bed3da8bf4ea85b9e22 @myui committed Oct 18, 2013
View
2 src/main/hivemall/classifier/BinaryOnlineClassifierUDTF.java
@@ -200,7 +200,7 @@ protected float predict(final List<?> features) {
if(biasKey != null) {
WeightValue biasWeight = weights.get(biasKey);
if(biasWeight != null) {
- score += biasWeight.getValue();
+ score += (biasWeight.getValue() + bias);
}
}
View
2 src/main/hivemall/regression/OnlineRegressionUDTF.java
@@ -204,7 +204,7 @@ protected float predict(final Collection<?> features) {
if(biasKey != null) {
FloatWritable biasWeight = weights.get(biasKey);
if(biasWeight != null) {
- score += biasWeight.get();
+ score += (biasWeight.get() * bias);
}
}
View
BIN target/hivemall.jar
Binary file not shown.

0 comments on commit f895269

Please sign in to comment.