Andrew Ng机器学习笔记week1 线性回归
第一周主要是对机器学习进行简单的介绍和线性回归的知识点:
一、Introduction
machine learning的举例
machine learning定义和例题
machine learning分类
- Supervised learning
right answer given,有标记的
1.regression:continuous(house price prediction)
2.classification:discrete(breast cancer:malignant or benign)
-Unsupervised learning
无标记的,we’re not told what to do with and what each point is.
cluster
①Organize computing clusters
②Social network analysis
③Market segmentation
④Astronomical data analysis
例:Cocktail party problem (鸡尾酒会问题):
separate out these two audio sources that were being added or being summed together to form other recordings.
[W,s,v] = svd((repmat(sum(x.*x,1),size(x,1),1).*x)*x’);
-Reinforcement learning(强化学习)
- recommender systems(推荐系统)
二、Linear regression with one variable
1.Model representation
2.Cost function
代价函数计算的主要代码块:
h=X*theta;
sqr=(h-y).^2;
J=sum(sqr)/(2*m);
3.Gradient descent
4.Gradient descent for linear regression
梯度下降中theta计算的代码块:
h=X*theta;
error=h-y;
delta=X’*error/m;
theta=theta-alpha*delta;
三、Linear Algebra review
矩阵、向量的转置、相乘等线性代数的知识点回顾