machine learning (7)---normal equation相对于gradient descent而言求解linear regression问题的另一种方式
- Normal equation: 一种用来linear regression问题的求解Θ的方法,另一种可以是gradient descent
- 仅适用于linear regression问题的求解,对其它的问题如classification problem或者feature number太大的情况下(计算量会很大)则不能使用normal equation,而应使用gradient descent来求解。
(由求导的过程推导而得)
这种方法是对cost function(J(θ),θ为n+1维向量(θ0,θ1.....θn))对各个θ求偏导,令偏导为0,这样求出对应的θ(高等数学里面求极值的方法),这 样求出的θ,使cost function的值最小
例如: 
如何求解θ 
- 这种求解θ的方法可不进行feature scaling,而对于用gradient descent求解θ而言,feature scaling很重要,它可使收敛速度加快。
- normal equation与gradient descent两种方法优点与缺点比较

- 当n>10000时,即feature number>10000时,用normal equation消耗太大,这时倾向于使用gradient desccent或者其它算法
- 当n<1000时,使用normal equation更方便
machine learning (7)---normal equation相对于gradient descent而言求解linear regression问题的另一种方式的更多相关文章
- machine learning 笔记 normal equation
theta=(Xt*X)^-1 Xt*y x is feature matrix y is expectation
- (转)Introduction to Gradient Descent Algorithm (along with variants) in Machine Learning
Introduction Optimization is always the ultimate goal whether you are dealing with a real life probl ...
- 【转】Derivation of the Normal Equation for linear regression
I was going through the Coursera "Machine Learning" course, and in the section on multivar ...
- Coursera, Machine Learning, notes
Basic theory (i) Supervised learning (parametric/non-parametric algorithms, support vector machine ...
- Machine Learning - week 2 - Multivariate Linear Regression
Multiple Features 上一章中,hθ(x) = θ0 + θ1x,表示只有一个 feature.现在,有多个 features,所以 hθ(x) = θ0 + θ1x1 + θ2x2 + ...
- [C2P2] Andrew Ng - Machine Learning
##Linear Regression with One Variable Linear regression predicts a real-valued output based on an in ...
- [C2P3] Andrew Ng - Machine Learning
##Advice for Applying Machine Learning Applying machine learning in practice is not always straightf ...
- 机器学习入门:Linear Regression与Normal Equation -2017年8月23日22:11:50
本文会讲到: (1)另一种线性回归方法:Normal Equation: (2)Gradient Descent与Normal Equation的优缺点: 前面我们通过Gradient Desce ...
- Machine Learning - 第3周(Logistic Regression、Regularization)
Logistic regression is a method for classifying data into discrete outcomes. For example, we might u ...
随机推荐
- 利用VBA来实现,输入日文之后,输出它的假名即读法
背景:当你输日文汉字的额时候,输出它的读音. 如下图所示 实现的代码如下 Option Explicit ' Replace を まとめて おこなう Private Function ReplaceA ...
- 在ensp上配置Hybrid接口
Hybrid接口是华为特有的一种接口 Hybrid接口是既可以连接普通终端的接入链路,又可以连接交换机间的干道链路. 简单说就是Hybrid接口既能实现Access的功能又能实现Trunk接口的功能. ...
- java 模拟多ip访问
java模拟多ip请求 package url_demo; import java.io.BufferedReader; import java.io.IOException; import java ...
- c++基础(三)——容器
1. 顺序容器 vector和string将元素保存在连续的内存空间中.由于元素是连续存储的,由元素的下标来计算其地址是非常快速的.但是在这两种容器的中间位置添加或删除元素就非常耗时 list和for ...
- 通过Anaconda安装的jupyter notebook,打开时,未能启动默认浏览器
问题:通过Anaconda安装的jupyter notebook,通过开始菜单的快捷方式打开时,未能启动网页,需要复制url,粘贴到浏览器中才会出现工作面板. 解决方法: 修改jupyter_note ...
- Python3实现一个简单的tcp客户端,用于测试服务端端口开放情况
需要Python的socket模块儿,windows使用netstat -an查看端口状态,Linux使用netstat -tunlp查看端口状态. # client 客户端 # TCP必须建立连接 ...
- logrus 剖析之 formatter
使用 logrus 通过 formatter 来定义输出日志的格式,具体例子如下: package main import ( log "github.com/Sirupsen/logrus ...
- promise实现
目录 promise实现 Promise 是 ES6 新增的语法,解决了回调地狱的问题. 可以把 Promise 看成一个状态机.初始是 pending 状态,可以通过函数 resolve 和 rej ...
- 【.Net Core】编译时禁止自动生成netcoreapp文件夹
原文:[.Net Core]编译时禁止自动生成netcoreapp文件夹 每次在编译生成文件时,VS都会自动在<OutputPath>属性指定的路劲后再追加一个用NetCore命名的文件夹 ...
- Replace到达地
string getcstr(string cs) { String SplitKey = @"乌孜别克族,柯尔克孜族,维吾尔族, 鄂伦春族, 哈萨克族, ...