<p dir="auto">MultinomialNB inherits coef_, intercept_ from BaseDiscreteNB defined by</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
    def _get_coef(self):
        return (self.feature_log_prob_[1:]
                if len(self.classes_) == 2 else self.feature_log_prob_)

    def _get_intercept(self):
        return (self.class_log_prior_[1:]
                if len(self.classes_) == 2 else self.class_log_prior_)

    coef_ = property(_get_coef)
    intercept_ = property(_get_intercept)"><pre class="notranslate">    <span class="pl-k">def</span> <span class="pl-en">_get_coef</span>(<span class="pl-s1">self</span>):
        <span class="pl-k">return</span> (<span class="pl-s1">self</span>.<span class="pl-s1">feature_log_prob_</span>[<span class="pl-c1">1</span>:]
                <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">classes_</span>) <span class="pl-c1">==</span> <span class="pl-c1">2</span> <span class="pl-k">else</span> <span class="pl-s1">self</span>.<span class="pl-s1">feature_log_prob_</span>)

    <span class="pl-k">def</span> <span class="pl-en">_get_intercept</span>(<span class="pl-s1">self</span>):
        <span class="pl-k">return</span> (<span class="pl-s1">self</span>.<span class="pl-s1">class_log_prior_</span>[<span class="pl-c1">1</span>:]
                <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">classes_</span>) <span class="pl-c1">==</span> <span class="pl-c1">2</span> <span class="pl-k">else</span> <span class="pl-s1">self</span>.<span class="pl-s1">class_log_prior_</span>)

    <span class="pl-s1">coef_</span> <span class="pl-c1">=</span> <span class="pl-en">property</span>(<span class="pl-s1">_get_coef</span>)
    <span class="pl-s1">intercept_</span> <span class="pl-c1">=</span> <span class="pl-en">property</span>(<span class="pl-s1">_get_intercept</span>)</pre></div>
<p dir="auto">For binary classification, in order to be consistent with LinearClassifierMixin, the coef_(intercept_) should be the difference between second and first rows(elements)</p>
<p dir="auto">Hello. I think I found a mistake in brier_score_loss.<br>
When you have a target = 1 and a prediction = 1 too, brier_score_loss should be 0 (best result), but it gives 1. Why is it happening? Because _check_binary_probabilistic_predictions gets target with only one class and convert it to 0. And metric calculates for target = 0 and prediction = 1. The same problem for target = 1 and prediction = 0. brier_score_loss is 0 (the best result), but it should be 1.</p>
<p dir="auto">Examples:<br>
Approx = [0, 0, 0, 0]<br>
Target = [1, 1, 1, 1]<br>
Weight = [1, 1, 1, 1]<br>
brier_score_loss(Target, Approx, sample_weight=Weight)<br>
result is 0</p>
<p dir="auto">Approx = [1, 1, 1, 1]<br>
Target = [1, 1, 1, 1]<br>
Weight = [1, 1, 1, 1]<br>
brier_score_loss(Target, Approx, sample_weight=Weight)<br>
result is 1</p>
<p dir="auto">Maybe we should fix it? Thank you.</p>