[scikit-learn] Generate data from trained naive bayes
t3kcit at gmail.com
Mon Oct 3 09:07:56 EDT 2016
Yes, you could, but as the model is very simple, that's usually not very
It stores for each label an independent Bernoulli distribution for each
these are stored in feature_log_prob_.
I would suggest you look at this attribute, rather than sample from the
To sample from it you would have to exponentiate it and then sample from
these Bernoulli distributions.
On 10/03/2016 07:30 AM, klo uo wrote:
> because naive bayes is a generative model, does that mean that I can
> somehow generate data based on trained model?
> For example:
> clf = BernoulliNB()
> clf.fit(train, labels)
> Can I generate data for specific label?
> scikit-learn mailing list
> scikit-learn at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the scikit-learn