Andrew Ng机器学习笔记1

来源:互联网 发布:系统检测修复软件 编辑:程序博客网 时间:2024/06/14 11:45
Introduction


1. What is Machine Learning:
1). Field of study that gives computers the ability to learn without being explicitly programmed.
2). A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.



2. Supervised Learning VS Unsupervised Learning
监督学习和非监督学习之间最本质的区别就是训练数据是否有标签,有标签就是监督学习,否则称为非监督学习,也称为聚类(clustering)


3. Regression VS Classfication
回归问题是连续数据上的模型构建问题,例如房价与面积的关系;分类问题是离散数据上的问题,例如是否恶性肿瘤与肿瘤大小的关系。


Model and Cost Function
1. a function h: X->Y so that h(x) is a "good" predictor for the corresponding value of y. We call function h a hypothesis. 这里使用的是线性回归。
2. Cost function is introduced to mesure the accuracy of the hypothesis function. 最常用的是"Squared error function"。
3. 通过选取符合的model function并通过找到一个最小的cost function, 来得到model function中的各个参数大小,从而建立机器学习模型。





Gradient descent
Gradient descent is a method for finding the minimum of a cost function.
多参数必须做到同时更新。如果非同时更新,可能结果也对所以不会注意到,但是会有微小的不同。
如果学习率太小,下降的慢,迭代次数多。
如果太大,可能无法收敛甚至发散(一步太大)。
容易达到局部最低点(和初始值有关),此时导数为0,会停止下降。当接近最低点时,步长会自动变小,因此没有必要减少学习率,固定即可。
由于线性回归的代价函数都是凸函数(碗形),因此用梯度下降法都能得到全局最优。


原创粉丝点击