sklearn.metrics.mean_poisson_deviance?
sklearn.metrics.mean_poisson_deviance(y_true, y_pred, *, sample_weight=None)
平均泊松偏差回歸損失。
泊松偏差等于功率參數power=1的Tweedie偏差。
在用戶指南中閱讀更多內容。
參數 | 說明 |
---|---|
y_true | array-like of shape (n_samples,) 真實目標值。 要求y_true> = 0。 |
y_pred | array-like of shape (n_samples,) 預測目標值。 要求y_pred> 0。 |
sample_weight | array-like of shape (n_samples,), default=None 樣本權重。 |
返回值 | 說明 |
---|---|
loss | float 非負浮點值(最佳值為0.0)。 |
示例
>>> from sklearn.metrics import mean_poisson_deviance
>>> y_true = [2, 0, 1, 4]
>>> y_pred = [0.5, 0.5, 2., 2.]
>>> mean_poisson_deviance(y_true, y_pred)
1.4260...