<div dir="ltr"><div>Thanks Andy,<br><br></div>I can comprehend to the point "...and then sample
    from these Bernoulli distributions"<br><br>From the data in `feature_log_prob_`, I would guess it contains single feature (features mean from the trained data) for each class.<br>I can see how can I sample from  `feature_log_prob_`...<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 3, 2016 at 3:07 PM, Andreas Mueller <span dir="ltr"><<a href="mailto:t3kcit@gmail.com" target="_blank">t3kcit@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi Klo.<br>
    Yes, you could, but as the model is very simple, that's usually not
    very interesting.<br>
    It stores for each label an independent Bernoulli distribution for
    each feature.<br>
    these are stored in feature_log_prob_.<br>
    I would suggest you look at this attribute, rather than sample from
    the distribution.<br>
    To sample from it you would have to exponentiate it and then sample
    from these Bernoulli distributions.<br>
    <br>
    Andy<div><div class="h5"><br>
    <br>
    <div class="m_4190284293545002776moz-cite-prefix">On 10/03/2016 07:30 AM, klo uo wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>Hi,<br>
                <br>
                because naive bayes is a generative model, does that
                mean that I can somehow generate data based on trained
                model?<br>
                <br>
              </div>
              For example:<br>
              <br>
              <span style="font-family:monospace,monospace">clf =
                BernoulliNB()<br>
                clf.fit(train, labels)</span><br>
              <br>
            </div>
            Can I generate data for specific label?<br>
            <br>
            <br>
          </div>
          Thanks,<br>
        </div>
        Klo<br>
      </div>
      <br>
      <fieldset class="m_4190284293545002776mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
scikit-learn mailing list
<a class="m_4190284293545002776moz-txt-link-abbreviated" href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a>
<a class="m_4190284293545002776moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/scikit-learn" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a><br>
<br></blockquote></div><br></div>