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 ...
随机推荐
- Linux学习-软件包管理安装
rpm RPM是Red-Hat Package Manager(RPM软件包管理器)的缩写 软件包类型 二进制包:已经使用GCC编辑后的 tar源码包:需要编译 rpm包获取方式 1,系统镜像 需 ...
- [十一集训] Day1 (2018-2019 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2018))
A Altruistic Amphibians 原题 题目大意: n只青蛙在高度为d的井中,每只有跳跃距离.重量和高度,每只青蛙可以借助跳到别的青蛙的背上而跳出井,每只青蛙能承受的最大重量是自身重量, ...
- 酷!微软发布新终端工具,Win 10 将自带 Linux 内核
原创:技术最前线(id:TopITNews) 北京时间 5 月 7 日,2019 年微软 Build 开发者大会在雷德蒙德召开.今年大会上亮点很多,本文汇总一些和开发者相关的内容. 1. Window ...
- pdfplumber模块初始用
import pdfplumber import re def pdf_read(): pdf=pdfplumber.open('文件路径'")#文件路径,读取文件 page0=pdf.pa ...
- C#中的Process类使用
有时候,用户在进行某个操作时,程序运行到某个阶段突然崩溃,我们需要让程序自动重启,重新执行用户之前的操作,当发现主程序还存在,就重启用户执行的附加程序.这时候Process就派上了用场. 控制台测试用 ...
- 无法将文件xxx复制到xxx文件xxx正由另一进程使用,因此该进程无法访问此文件
对于VS2017,可以这样处理,开始——>运行——>tskill msbuild,然后重新生成即可.
- WebClient 请求 https 页面出错:未能创建 SSL/TLS 安全通道
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | Securi ...
- apache-httpd代理请求,selinux造成503问题的解决方法
NameVirtualHost *:80 <VirtualHost *:80> ServerName test.baidu.com ProxyPreserveHost on ProxyPa ...
- NameError: name “ ” is not defined
NameError: name “ ” is not defined 问题一:name ‘name’ is not defined "name"两端是双下划线"_&quo ...
- vue初级使用
一.Vue是什么? Vue(读音 /vjuː/, 类似于 view)是一个构建数据驱动的 web 界面的渐进式框架.采用自底向上增量开发的设计.Vue.js 的目标是通过尽可能简单的 API 实现响应 ...