Skip to content

Commit

Permalink
added patch from Low012 as submitted in
Browse files Browse the repository at this point in the history
#256 (comment)
which addresses a problem in the Bayesian Classifier source code as
discussed in
ptnplanet/Java-Naive-Bayes-Classifier#3
  • Loading branch information
Orbiter committed Mar 8, 2016
1 parent 1406fd5 commit 65ede16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/org/loklak/objects/MessageEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,8 @@ public Map<String, Object> toMap(final UserEntry user, final boolean calculatedD
assert c.getValue() != null;
if (c.getValue().getCategory() == Classifier.Category.NONE) continue; // we don't store non-existing classifications
m.put("classifier_" + c.getKey().name(), c.getValue().getCategory());
m.put("classifier_" + c.getKey().name() + "_probability", c.getValue().getProbability());
m.put("classifier_" + c.getKey().name() + "_probability",
c.getValue().getProbability() == Float.POSITIVE_INFINITY ? Float.MAX_VALUE : c.getValue().getProbability());
}
}

Expand Down

0 comments on commit 65ede16

Please sign in to comment.