When training the model, the goal is to minimize the error and update the model coefficients to achieve the best fit line.
Error is the difference between predicted value (Y) generated by the model and the class attribute value
机器学习中成本函数L是用于计算误差的一个函数
是Observed value,图中彩色点的y值
是Predicted value,从彩色点到直线并垂直于x轴的线
是彩色线的长度,其含义是单个点的误差
将所有点的误差相加并平方的结果就是成本函数所得出的结果