回归模型评估 - 结果对照图
取一定数量的样本,将真实值和预测值的结果画在一张图上即为结果对照图。
结果对照图可以直观的展示预测结果和真实值之间的差距和走势。
A |
|
1 |
=T("houseprice_result.xls").to(100) |
2 |
=canvas() |
3 |
=A2.plot("NumericAxis","name":"x") |
4 |
=A2.plot("NumericAxis","name":"y","location":2,"autoRangeFromZero":false) |
5 |
=A2.plot("Line","markerStyle":0,"lineColor":-16776961,"axis1":"x","data1":to(A1.len()),"axis2":"y","data2": A1.(SalePrice)) |
6 |
=A2.plot("Line","markerStyle":0,"lineColor":-61184,"axis1":"x","data1":to(A1.len()),"axis2":"y","data2": A1.(SalePrice_predictvalue)) |
7 |
=A2.draw(800,400) |
A1 取100条数据。用户可根据实际需求选取画图的样本
A2-A7 以样本数为x轴,真实值(蓝色线)和预测值(红色线)为y轴画折线图,得到结果对照图