max_error#
- sklearn.metrics.max_error(y_true, y_pred)[源代码]#
max_oss指标计算最大残余误差。
阅读更多的 User Guide .
- 参数:
- y_true形状类似阵列(n_samples,)
地面真相(正确)目标值。
- y_pred形状类似阵列(n_samples,)
估计目标值。
- 返回:
- max_error浮子
正浮点值(最佳值为0.0)。
示例
>>> from sklearn.metrics import max_error >>> y_true = [3, 2, 7, 1] >>> y_pred = [4, 2, 7, 1] >>> max_error(y_true, y_pred) np.int64(1)