utcompling/Scalabha — pull request #4 by dhgarrette (2012-05-18 04:20:14+00:00)
Title: Fixed potential bug in NaiveBayesClassifier and cleaned up a little

The last line of the `classify` method was `labels.zip(logprobs)`, but `labels` is a `Set`, so we can't guarantee that its items will iterate in the same order as those in `logprobs`. Inconsistent iteration order would cause mismatches between labels and values. I corrected the by making `unnormalizedScores` a `Set[(L, LogNum)]`, so that zipping later is not required.

Furthermore, I cleaned up a few things by using methods provided by `CollectionUtils`. In particular, I used `normalizeValues`, `sumBy`, `mapTo`, and `mapToVal`.