Skip to content

Commit

Permalink
ups...
Browse files Browse the repository at this point in the history
  • Loading branch information
ptnplanet committed Mar 11, 2012
1 parent 789f9c9 commit 654df58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ public float featureWeighedAverage(T feature, K category,
? this.featureProbability(feature, category)
: calculator.featureProbability(feature, category);

int totals = this.totalFeatureCount.get(feature);
Integer totals = this.totalFeatureCount.get(feature);
if (totals == null)
totals = 0;
return (weight * assumedProbability + totals * basicProbability)
/ (weight + totals);
}
Expand Down

0 comments on commit 654df58

Please sign in to comment.