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 ...
随机推荐
- OpenStack-keystone命令行
Keystone简介 Keystone(OpenStack Identity Service)是OpenStack框架中,负责身份验证.服务规则和服务令牌的功能, 它实现了OpenStack的Iden ...
- 通过python批量修改mp3名称
下载歌曲软件:音乐狂 下载格式:[xxxx]xxxx.mp3 import osimport re path = 'c:\\test' old_dir = os.listdir(path) print ...
- Mahalanobia Distance(马氏距离)的解释
马氏距离有多重定义: 1)可以表示 某一个样本与DataSet的距离. 2)可以表示两个DataSet之间的距离. 1) The Mahalanobis distance of an observat ...
- PHP设计模式 - 桥接模式
将抽象部分与它的实现部分分离,使他们都可以独立的变抽象与它的实现分离,即抽象类和它的派生类用来实现自己的对象 桥接与适配器模式的关系(适配器模式上面已讲解): 桥接属于聚合关系,两者关联 但不继承 适 ...
- python基础 — Selenium 详细介绍
一.Selenium+Python环境搭建及配置 1.1 selenium 介绍 selenium 是一个 web 的自动化测试工具,不少学习功能自动化的同学开始首选 selenium ,因为它相比 ...
- day29——socket套接字(少量不全)
day29 socket套接字 socket是处于应用层与传输层之间的抽象层,他是一组操作起来非常简单的接口(接受数据)此接口接受数据之后,交由操作系统. 为什么存在socket抽象层? 如果直接与操 ...
- Go语言( 函数)
函数是组织好的.可重复使用的.用于执行指定任务的代码块.本文介绍了Go语言中函数的相关内容. 函数 Go语言中支持函数.匿名函数和闭包,并且函数在Go语言中属于“一等公民”. 函数定义 Go语言中定义 ...
- Java -- 基于JDK1.8的ThreadLocal源码分析
1,最近在做一个需求的时候需要对外部暴露一个值得应用 ,一般来说直接写个单例,将这个成员变量的值暴露出去就ok了,但是当时突然灵机一动(现在回想是个多余的想法),想到handle源码里面有使用过Th ...
- python之json库的使用
JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,易于人阅读和编写. 1.json库的使用 使用 JSON 函数需要导入 json 库:import jso ...
- Sqlite in flutter, how database assets work
First off, you will need to construct a sqlite database from your csv. This can be done in the follo ...