<p><strong>注意:</strong>我很欣赏大量的评论,认为这不适合量化模型性能。然而,这与我的错误无关,而且这种错误发生在其他各种度量中。另外,请参阅<a href="https://meta.stackoverflow.com/questions/254341/a-car-with-square-wheels">here</a>以了解当您认为操作是“问错问题”时的适当响应方式</p>
<p>我有一个sklearn物流模型,我正试图得到RMSE。然而,当我<code>.predict_proba</code>时,我得到了一个概率向量。然而,我的<code>y_test</code>是它的范畴形式,<code>sklearn.linear_model.LogisticRegression</code>只是自动处理。在</p>
<p>我如何协调这两件事来得到RMSE?在</p>
<pre><code>>>> sklearn.metrics.mean_squared_error(y_test, pred_proba, sample_weight=weights_test)
ValueError: y_true and y_pred have different number of output (1!=13)
</code></pre>
<p>以下是计算RMSE的方法:</p>
<pre><code>import numpy as np
from sklearn.metrics import mean_squared_error
x = np.range(10)
y = x
rmse = np.sqrt(mean_squared_error(x, y))
</code></pre>