简体   繁体   English

线性回归 model 中 MAPE 的解释?

[英]Interpretation of MAPE in Linear Regression model?

I made a Linear Regression in Python.I computed the MAPE as follows, and got a value of 0.052:我在 Python 中做了一个线性回归。我计算了 MAPE,得到的值为 0.052:

mean_absolute_percentage_error(y_test, pred_test)

Does this mean that my mean percentage error is 0.052% or 5.2%?这是否意味着我的平均百分比误差为 0.052% 或 5.2%?

In your case, it means 5.2%.在您的情况下,这意味着 5.2%。 You can easily test this, for example if we have the prediction to be 80% of the true, then the error will be 20% and you can see you get 0.2:您可以轻松地对此进行测试,例如,如果我们有 80% 的预测为真,那么误差将为 20%,您可以看到您得到 0.2:

from sklearn.metrics import mean_absolute_percentage_error
y_true = [3.3, 1.5, 2.1, 7.2]
y_pred = [0.8*i for i in y_true]

mean_absolute_percentage_error(y_true, y_pred)
Out[9]: 0.19999999999999996

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM