回归模型评估 - 残差图

 

残差residual=真实值-预测值

计算houseprice_result.xls中的残差并画图


A

1

=T("houseprice_result.xls")

2

=A1.derive(SalePrice-SalePrice_predictvalue:Residual)

3

=canvas()

4

=A3.plot("NumericAxis","name":"x")

5

=A3.plot("NumericAxis","name":"y","location":2,"autoRangeFromZero":false)

6

=A3.plot("Dot","lineWeight":0,"lineColor":-16776961,"markerWeight":1,"axis1":"x","data1":A2.(SalePrice),"axis2":"y","data2": A2.(Residual))

7

=A3.draw(800,400)

A2 计算残差Residual

A3-A7 x轴取SalePricey轴取Residual画散点图即为残差图

..