擅长:python、mysql、java
<p><code>predict_prob</code>计算每个类别<strong>一个样本的概率。[0.95 0.05]表示在模型的95%决策树中,这些<strong>唯一样本的输出为0类;5%为一级。因此,您正在逐个评估每个样本</p>
<p>当您这样做时:</p>
<pre><code>classifier.predict_proba(example_feature_set)[0]
</code></pre>
<p>对于<code>example_feature_set</code>的第一个样本,您将获得成为每个类的概率</p>
<p>我想你想要的是每门课的准确度或召回率。(如果您不熟悉,请检查这些分数的含义)</p>
<p>要计算这些,我建议使用以下代码:</p>
<pre><code>from sklearn.metrics import classification_report
y_pred=classifier.predict(example_feature_set) #I'm assuming you have more than one sample to predict
print(classification_report(y_test,y_pred))
</code></pre>
<p>然后,您将获得一些可以帮助您的措施</p>