如何确定数据点的回归线(理论)? [关闭]

问题描述 投票:-2回答:1

确定以下数据点的回归线:

(x1, y1) = (1, 4), (x2, y2) = (2, 3), (x3, y3) = (3, 9)

function h(x) = w + hx,可以最大限度地减少此数据的平方误差损失。

machine-learning data-science
1个回答
0
投票

这个问题归结为数学。

首先,我们编写错误函数

enter image description here

误差函数的导数告诉我们在改变变量时误差如何变化。因为有两个变量(m和b),它是偏导数。当导数等于零时,我们知道我们已达到最小值(因为我们采用二次方程的导数,我们知道有一个全局最小值)。

enter image description here

在总和中写出每个术语给我们

enter image description here

两个变量,两个方程意味着我们可以解决两个问题!

enter image description here

在你的情况下,我们有h = m和w = b

作为一个双重检查,Desmos是一个伟大的工具https://www.desmos.com/calculator

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.