平均泊松偏差#
- sklearn.metrics.mean_poisson_deviance(y_true, y_pred, *, sample_weight=None)[source]#
- 平均泊松偏差回归损失。 - 泊松偏差等价于幂参数为 - power=1的Tweedie偏差。- 更多信息请参考用户指南。 - 参数:
- y_truearray-like of shape (n_samples,)
- 真实目标值。要求y_true >= 0。 
- y_predarray-like of shape (n_samples,)
- 预测目标值。要求y_pred > 0。 
- sample_weightarray-like of shape (n_samples,), default=None
- 样本权重。 
 
- 返回值:
- 损失浮点数
- 一个非负的浮点值(最佳值为 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... 
 
    