Linear Regression
Hypothesis:
Parameters:
Cost Function:
Goal:
minimize
Gradient Descent
Outline:
- start with some
- Keep changing to reduce ,until we end up at a minimum
Algorithm:
repeat until convergence
tips:
- (simultaneously update and )
-
learning rate
if alpha is too small, gradient descent can be slow
if alpha is too large, gradient descent can overshoot the minimum. it may fail to converge or even diverge
多元线性回归
Hypothesis:
问题有那个特征量,则预测函数为:
假设
写成矩阵形式:
故:
Cost Function:
Multiple Gradient Descent
Algorithm:
Feature Scaling(特征缩放)
Goal:
Get every feature into approximately a range
Aligorithm
Mean Normalization(缩放到接近0水平)
Goal
Replace with to make features have approximately zero mean
Algorithm
Polynomial Regression
图片.png
Advantage and Disadvantage between gradient descent and normal equation:
Normal Equation(正规方程法)
对代价函数求偏导 图片.png
网友评论