机器学习笔记之正规方程
来源:互联网 发布:龚琳娜山中问答知乎 编辑:程序博客网 时间:2024/05/22 04:54
Normal Equation
Note: [8:00 to 8:44 - The design matrixX (in the bottom right side of the slide) given in the example should haveelements x with subscript 1 and superscripts varying from 1 to m because forall m training sets there are only 2 features x0 and x1. 12:56 - The Xmatrix is m by (n+1) and NOT n by n. ]
Gradient descentgives one way of minimizing J. Let’s discuss a second way of doing so, thistime performing the minimization explicitly and without resorting to aniterative algorithm. In the "Normal Equation" method, we will minimize J by explicitly taking its derivatives with respect to the θj ’s, andsetting them to zero. This allows us to find the optimum theta without iteration. The normal equation formula is given below:
θ=(XTX)−1XTy
There is noneed to do feature scaling with the normal equation.
The following isa comparison of gradient descent and the normal equation:
Gradient Descent
Normal Equation
Need to choose alpha
No need to choose alpha
Needs many iterations
No need to iterate
O (kn2)
O (n3), need to calculate inverse of XTX
Works well when n is large
Slow if n is very large
With the normal equation, computing the inversion has complexity O(n3). So if we havea very large number of features, the normal equation will be slow. In practice,when n exceeds 10,000 it might be a good time to go from a normal solution toan iterative process.
- 机器学习笔记之正规方程
- 机器学习笔记(2)---监督学习之正规方程
- 机器学习之正规方程法
- 机器学习之——多项式回归和正规方程
- 机器学习之——多项式回归和正规方程
- 机器学习入门(12)--线性回归之正规方程
- 机器学习-线性回归-正规方程
- 机器学习笔记(一):梯度下降算法,随机梯度下降,正规方程
- 机器学习笔记(二)----线性方程拟合的正规方程法*(推荐网址)
- 斯坦福大学机器学习笔记——特征和多项式回归以及正规方程
- 【机器学习入门】Andrew NG《Machine Learning》课程笔记之三:多元线性回归的梯度下降、特征缩放和正规方程
- 机器学习笔记之正规矩阵的不可逆性
- 机器学习05-学习率与正规方程
- Stanford机器学习---第二周.特征缩放、正规方程
- 机器学习02线性回归、多项式回归、正规方程
- 机器学习_正规方程(最小二乘法)的推导
- Coursera 机器学习(by Andrew Ng)课程学习笔记(二)——多元线性回归和正规方程
- 机器学习(2)之正规方程组
- Socket和ServerSocket
- memcpy
- java web工程web.xml配置详解
- vue.js 组件之间传递数据
- POJ Terrible Sets
- 机器学习笔记之正规方程
- Mysql学习历程基本语法(8)-字符串类型
- java 数组
- c++之知识点整理
- 利用nodemcu以及Python数据处理进行的wifi的局域网远程温度测量
- idea搭建mybatis案例
- IE8 CSS 样式兼容性清单
- 机器学习笔记之正规矩阵的不可逆性
- CentOS7进入单用户模式重置ROOT密码