Machine Learning by Andrew Ng on Coursera Week1(Coursera机器学习课程第一周总结)

Machine Learning  by Andrew Ng on Coursera 

      机器学习是近年来的一大热门学科,本人对此非常感兴趣,正好本学期学校开设机器学习MOOC课程,可以学习Coursera正版机器学习课程,于是决定每周在此总结学习的内容与大家分享。

Week1:

第一周的内容不多,主要是介绍一些基础知识,初步讲解代价函数和梯度下降法。

What is machine learning? –A computerprogram is said to learn from experience E with respect to some class of tasksT and performance measure P. If its performance as tasks in T, as measured byP, improves with experience E.

Supervised Learning 监督学习:

 know what correct output should look like.

  • regression continuous output (eg : predict the house price) 
  • classification discrete output (eg : predict whether the tumor is malignant or benign)

Unsupervised Learning 非监督学习:

Approach problems with little or no idea what our results should look like.

Model Representation:

m = Number of training examples

x = input variable/features

y = output variable/target variable

(x,y) = one training example



Cost Function 代价函数








代价函数越小,函数对原数据对拟合越好。如上图可以看出,时,对原数据拟合的最好,通过了所有的点,此时可以看到,取到最小值0。


同样,在二维特征的情况下,如上图所示,的图像为一个三维曲面,同样,在取最小值时,函数的拟合情况最好。

因此学习算法的优化目标是找到一组  的值来将  最小化。

Gradient Descent梯度下降:

知道了cost function的作用以及其与函数拟合情况的关系后,就需要有方法来求出使代价函数最小的参数值,其中之一即是gradient descent。

gradient descent的原理:想象一下你正站立在山上 想要快速下山,在梯度下降算法中,我们要做的就是旋转360度,看看我们的周围,并问自己,如果我想尽快走下山,这些小碎步需要朝什么方向?在山上的新起点上,你环顾四周,并决定从什么方向将会最快下山,然后又迈进了一小步,又是一小步,并依此类推,直到局部最低点的位置。

repeat until convergence{


}


 means assign b to a。

 is the learning rate, it can control the update step-size of 

if  is too small, gradient descent can be slow;

if  is too large, gradient descent can overshoot the minimum, it may fail to converge, or even diverge.



如上图所示,执行梯度下降时,据你设定的初始值的不同,你可能会得到不同的局部最优解。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值