机器学习笔记-1 Linear Regression(week 1)
1.Linear Regression with One variable
Linear Regression is supervised learning algorithm, Because the data set is given a right answer for each example.
And we are predicting real-valued output so it is a regression problem.
Block Diagram:
2. Cost Function
Idea: choose Θ0 and Θ1 so that h(x) is close to y for our training example
cost function:
(it a bow-shaped function )
So it became a mathematical problem of minimizing the cost function (Squared error funciton)
3. Gradient Descent
we are using gradient descent to minimize the cost function
Process:
1. Start with some random choice of the theta vector
2. Keep changing the theta vector to reduce J(theta) Until we end up at a minimum
Repeat until convergence:
(the derivative term is the slope of the cost function)
alpha is the learning rate And we need to a aimultaneous update for the theta vector.
1. If alpha is too small, the gradient descent is small
2. If alpha is too larger, gradient descent, it will overshoot the minimum, it may fail to converge.
And taking the derivative, we can get:
Convex function: a bow-shaped function just like the cost function J(theta)
Batch gradient descent: each step of gradient descent uses all the training examples(sum over all the training sample)
机器学习笔记-1 Linear Regression(week 1)的更多相关文章
- 机器学习笔记1——Linear Regression with One Variable
Linear Regression with One Variable Model Representation Recall that in *regression problems*, we ar ...
- 机器学习笔记-1 Linear Regression with Multiple Variables(week 2)
1. Multiple Features note:X0 is equal to 1 2. Feature Scaling Idea: make sure features are on a simi ...
- 斯坦福机器学习视频笔记 Week1 Linear Regression and Gradient Descent
最近开始学习Coursera上的斯坦福机器学习视频,我是刚刚接触机器学习,对此比较感兴趣:准备将我的学习笔记写下来, 作为我每天学习的签到吧,也希望和各位朋友交流学习. 这一系列的博客,我会不定期的更 ...
- Coursera台大机器学习课程笔记8 -- Linear Regression
之前一直在讲机器为什么能够学习,从这节课开始讲一些基本的机器学习算法,也就是机器如何学习. 这节课讲的是线性回归,从使Ein最小化出发来,介绍了 Hat Matrix,要理解其中的几何意义.最后对比了 ...
- Stanford机器学习---第一讲. Linear Regression with one variable
原文:http://blog.csdn.net/abcjennifer/article/details/7691571 本栏目(Machine learning)包括单参数的线性回归.多参数的线性回归 ...
- Machine Learning 学习笔记2 - linear regression with one variable(单变量线性回归)
一.Model representation(模型表示) 1.1 训练集 由训练样例(training example)组成的集合就是训练集(training set), 如下图所示, 其中(x,y) ...
- Andrew Ng机器学习编程作业: Linear Regression
编程作业有两个文件 1.machine-learning-live-scripts(此为脚本文件方便作业) 2.machine-learning-ex1(此为作业文件) 将这两个文件解压拖入matla ...
- Andrew Ng机器学习 一: Linear Regression
一:单变量线性回归(Linear regression with one variable) 背景:在某城市开办饭馆,我们有这样的数据集ex1data1.txt,第一列代表某个城市的人口,第二列代表在 ...
- 李宏毅机器学习笔记1:Regression、Error
李宏毅老师的机器学习课程和吴恩达老师的机器学习课程都是都是ML和DL非常好的入门资料,在YouTube.网易云课堂.B站都能观看到相应的课程视频,接下来这一系列的博客我都将记录老师上课的笔记以及自己对 ...
随机推荐
- 解决WebStorm无法连接到Chrome
问题: 点击 中的chrome时,出现了错误,如下: 解决办法: 找到 File>setting>Web Browser 修改为 C:\Program Files (x86)\Google ...
- Octave Tutorial(《Machine Learning》)之第二课《数据移动》
第二课 Moving Data 数据移动 常用内置函数 (1)加载文件 load 文件名.dat(或load('文件名.dat')) 接着输入文件名便可查看文件里的数据 (2)显示当前工作空间的所有变 ...
- Linux文件权限rwx简单了解
Ⅰ 了解Linux下的文件权限 如上图所示,ll命令详细展示当前目录下的文件或者子目录信息 红框标注的即为此文件或者目录的权限 [第一行文件10.c的权限以-开头,用来说明这是一个文件:第四行cod ...
- (28)初识struts框架
案例剖析中介绍了一个自己写的mystruts框架,这里开始简单的认识struts框架. 1.先看一个简单的struts开发的例子来熟悉一下流程 Struts就是基于mvc模式的框架! (struts其 ...
- SQL AlawaysOn 之三:SQL服务器加入域
声明:由于第一篇,配置域服务器,用的是别人的图,所以那个IP并不是我的. 至此为止,我的域控制器IP为192.168.8.230 域名为:dataserver.com 约定的SQL1 IP为192. ...
- Beautils工具类实现的原理
关于内省机制和反射机制请看这一篇博客[还没写完,在草稿中]. 先说一下什么叫做 bean 属性,bean 属性指的是 get / set 方法后的名称,而不是类的属性: 比如: private Str ...
- js的几种简单排序算法及其效率实测
function swap(arr,index1,index2){ var t = arr[index1]; arr[index1] = arr[index2]; arr[index2] = t; } ...
- Akamai在内容分发网络中的算法研究(翻译总结)
作者 | 钱坤 钱坤,腾讯后台开发工程师,从事领域为流媒体CDN相关,参与腾讯TVideo平台开发维护. 原文是<Algorithmic Nuggets in Content Delivery& ...
- Ubuntu 16.04 设置MySQL远程访问权限
本文记录一下在Ubuntu 16.04版本下设置MySQL数据库的远程访问. 第一步:修改配置文件的端口绑定 打开的目录可能会根据MySQL的版本稍有不同,可以先尝试打开/etc/mysql/my.c ...
- vue-router2.0简单路由嵌套
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...