• 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问题的另一种方式的更多相关文章

  1. machine learning 笔记 normal equation

    theta=(Xt*X)^-1 Xt*y x is feature matrix y is expectation

  2. (转)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 ...

  3. 【转】Derivation of the Normal Equation for linear regression

    I was going through the Coursera "Machine Learning" course, and in the section on multivar ...

  4. Coursera, Machine Learning, notes

      Basic theory (i) Supervised learning (parametric/non-parametric algorithms, support vector machine ...

  5. Machine Learning - week 2 - Multivariate Linear Regression

    Multiple Features 上一章中,hθ(x) = θ0 + θ1x,表示只有一个 feature.现在,有多个 features,所以 hθ(x) = θ0 + θ1x1 + θ2x2 + ...

  6. [C2P2] Andrew Ng - Machine Learning

    ##Linear Regression with One Variable Linear regression predicts a real-valued output based on an in ...

  7. [C2P3] Andrew Ng - Machine Learning

    ##Advice for Applying Machine Learning Applying machine learning in practice is not always straightf ...

  8. 机器学习入门:Linear Regression与Normal Equation -2017年8月23日22:11:50

    本文会讲到: (1)另一种线性回归方法:Normal Equation: (2)Gradient Descent与Normal Equation的优缺点:   前面我们通过Gradient Desce ...

  9. Machine Learning - 第3周(Logistic Regression、Regularization)

    Logistic regression is a method for classifying data into discrete outcomes. For example, we might u ...

随机推荐

  1. windwos 安装 vue-cli

    安装vue-cli 安装之前我们需要先安装node.js以及包管理工具npm,有兴趣的可以安装nvm版本管理工具 地址:https://www.cnblogs.com/lph970417/p/1184 ...

  2. win运行canal

    1.mysql开启log_bin 用命令查看是否开启 SHOW VARIABLES LIKE 'log_bin'; OFF为未开启,ON为开启 Win环境的话找到my.ini,Linux环境的话找到m ...

  3. Kubernetes集群安装(自己搭过,已搭好)

    k8s安装目录 1. 组件版本 && 集群环境 组件版本 etcd 集群 && k8s master 机器 && k8s node 机器 集群环境变量 ...

  4. 使用Xshell采用证书登录Linux

    1,工具--- 用户key生成向导,选择秘钥类型,注意DSA只能选择1024位级以下,超过1024位的服务器不认. 2 给公钥取一个名字,并设置密码,保存为文件 3 在linux 用户目录,用cd  ...

  5. STL源码剖析——Iterators与Traits编程#5 __type_traits

    上节给出了iterator_traits以及用到traits机制的部分函数的完整代码,可以看到traits机制能够提取迭代器的特性从而调用不同的函数,实现效率的最大化.显然这么好的机制不应该仅局限于在 ...

  6. int main(int argc, char *argv[])解释

    int main(int argc, char *argv[]) 详解: #include <stdio.h> int main(int argc, char *argv[]) { int ...

  7. 使用PHP开发HR系统(2)

    本节讲述如何创建基于CI框架的PHP程序. ============================================================================== ...

  8. GZOI/GXOI2019

    陆陆续续做完了-- 与或和(单调栈) 这是一道一眼题-- 看到位运算,按位考虑贡献.对于每一位,将矩阵中的元素变为"当前元素的这一位是否为\(1\)",那么原矩阵变为\(01\)矩 ...

  9. redis数据结构和常用命令

    redis常用数据结构 String 最简单的K_V,value可以是数字或者字符串,使用场景:微博数.普通计数,命令:get set incr(加1) decr(减1) mget(获取多个值),se ...

  10. sql 作业创建

    转载:https://jingyan.baidu.com/article/adc81513be3423f722bf7351.html