Replies: 3 comments 18 replies
-
Hi @Sandy4321, River provides MultinomialNB, BernoulliNB, GaussianNB and ComplementNB as sklearn does but does not provide CategoricalNB. New values and features are handled by Naive Bayes (with River). Models automatically update their states to handle these values. Naive Bayes models tend to rely on the class probability rather than the class probability given the new value when there are not enough samples for a given value, you can increase the parameter |
Beta Was this translation helpful? Give feedback.
-
see also my comments to about new data error- Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
-
CategoricalNB in scikit-learn does not have a direct method for incremental training or partial fitting like MultinomialNB, BernoulliNB, and GaussianNB. I think, CategoricalNB does not provide a partial_fit method. However, you can achieve incremental training for categorical data by manually updating the parameters of the model when new data becomes available. |
Beta Was this translation helpful? Give feedback.
-
is it possible incrementally train your code CategoricalNB Naive Bayes
do you have such kind of code example ?
lets say feature N3 has values : abc, hjki, deert, sdfr, qqqq, errttyy, etc
then model was trained initially
after new values was observed : "qwer", "abc", "abc", "abc","errttyy", "qwer","qwer","qwer","qwer"
1
when and how new value "qwer" will be used for prediction
2
how new value "qwer" willbe used for model retraining?
3
how new value "qwer" will be not used for model prediction and how prediction is happen by not using feature N3 when "qwer" observed , until we have many "qwer" observed for all classes ?
when scikit CategoricalNB can not predict / retrain for new values in features
https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.CategoricalNB.html#sklearn.naive_bayes.CategoricalNB
scikit only can deal with streaming data for MultinomialNB, BernoulliNB, and GaussianNB
they call it by "out-of-core-naive-bayes-model-fitting"
https://scikit-learn.org/stable/modules/naive_bayes.html#out-of-core-naive-bayes-model-fitting
MultinomialNB, BernoulliNB, and GaussianNB expose a partial_fit method that can be used incrementally as done with other classifiers
my guess full streaming naive-bayes should identify new values and automatically retrain model to handle this new values .
When only when we have enough observation for particular new values , we can start to use this value for predictions
Since if certain categorical value was observed let say 3 times for class "YES" and 50 times for class no; it can not be used still for prediction . Until at least we have 10 times for class "YES" .???
Beta Was this translation helpful? Give feedback.
All reactions