MultinomialNB fails when features have negative values
On my dataset machineJS failed because it was trying to use negative X values with multinomial Naive Bayes classifier.
Suggested solutions:
- Skip MultinomialNB when some of the features have negative values.
- Use GaussianNB instead.
- Normalize features to [0, 1] range.
Sweet, thanks for pointing that out! Out of curiosity, did the entire process break at that point, or did the rest of it continue to run with only MultinomialNB failing?
Your suggested solutions are solid. We're already doing feature normalization in data-formatter, so it shouldn't be too hard to expand that here. The other two look very straightforward as well. If you wanted to take a crack at any of those solutions, that'd be an easy PR to merge!
Thanks for reporting this! Keep the issues coming :)
multinomial don't take neg values, so while preprocessing numerical data best use is minmaxscaler()