Machine Learning by Stanford University

这是我在课程上尝试学习机器学习的过程记录。

一年前就听说过人工智能,但作为一个很难接受新事物的老人,一直没有真正的去研究。
但我似乎会在这一代 AI🤖️ 革命中失去工作。因此,我会努力学习它。
不过,我年纪大了,学不了,也没有信心保证有一天能掌握。

😂😂😂


1 Linear Regression with One Variable

2 Linear Regression with Multiple Variables

ex1

编码部分是我最喜欢的,我喜欢编码 😄

ComputeCost

You see, the cost function here
(OMG: the formula code is J(\theta) = \cfrac{1}{2m}\sum\limits_{i=1}^{m}(h_\theta(x^{(i)}) - y^{(i)} )^2 in markdown) 🤯

I found it is X * theta in the real calculation by Octave instead of theta' * X as the formula shows.

1
J = sum(((X * theta) - y).^2)/2/m

GradientDescent

同样,这里的梯度下降

repeat until convergence: {

}

1
theta = theta - alpha/m*(X' * ((X * theta) - y))

我花了好几个小时才弄明白为什么要用 X' * ((X * theta) - y))
因为所有的变量 X,theta ,y,每一个都是一个向量,X’ *(…)等于sum()部分,如公式所示。

我虽然通过了测试,但还是有点不明白 😵

3 Logistic Regression

To Be Continued…

1 Linear Regression with One Variable
2 Linear Regression with Multiple Variables