博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
02 Multivariate Linear Regression
阅读量:5163 次
发布时间:2019-06-13

本文共 1673 字,大约阅读时间需要 5 分钟。

  1. h(x)

    \[
    \begin{align*}h_\theta(x) =\begin{bmatrix}\theta_0 \hspace{2em} \theta_1 \hspace{2em} ... \hspace{2em} \theta_n\end{bmatrix}\begin{bmatrix}x_0 \newline x_1 \newline \vdots \newline x_n\end{bmatrix}= \theta^T x\end{align*}, x_0^{(i)} = 1
    \]

  2. Gradient descent equation

    \[
    \begin{align*}& \text{repeat until convergence:} \; \lbrace \newline \; & \theta_j := \theta_j - \alpha \frac{1}{m} \sum\limits_{i=1}^{m} (h_\theta(x^{(i)}) - y^{(i)}) \cdot x_j^{(i)} \; & \text{for j := 0...n}\newline \rbrace\end{align*}
    \]

  3. 当不同特征的值差距过大\((>10^5)\)时,需要特征缩放(Feature Scaling)

    \[

    x_i := \frac{x_i - \mu_i}{s_i}
    \]
    Where \(\mu_i\) is the average of all the values for feature(i) and \(s_i\) is the range of values(max - min), or \(s_i\) is the standard deviation.

  4. Learning Rate

    In automatic convergence test, declare convergence if \(J(\theta)\) decreases by less than \(1-^{-3}\) in one iteration.

  5. Features and Polynomial Regression

    可以将不同的特征值组合来更好的拟合数据,同时因为数据的组合,更加需要特征缩放来加快几何提高精度

  6. Normal Equation 正规方程 不需要特征缩放

    \[
    \theta = (X^TX)^{-1}X^Ty
    \]

  7. Comparation

    Gradient Descent Normal Equation
    need to choose \(\alpha\) No need to choose \(\alpha\)
    Needs many iterations Don’t need to iterate
    Works well even when n is large (\(>10^4\)) Need to compute \((X^TX)^{-1}\)
    \(O(kn^2)\) Slow if n is very large \(O(n^3)\)
  8. If \(X^TX\) is noninvertible, the common causes might be having :

    • Redundant features, where two features are very closely related (i.e. they are linearly dependent)
    • Too many features (e.g. m ≤ n). In this case, delete some features or use "regularization" (to be explained in a later lesson).

转载于:https://www.cnblogs.com/QQ-1615160629/p/02-Multivariate-Linear-Regression.html

你可能感兴趣的文章
Xamarin Visual Studio不识别JDK路径
查看>>
菜鸟“抄程序”之道
查看>>
Ubuntu下关闭防火墙
查看>>
TCP/IP 邮件的原理
查看>>
原型设计工具
查看>>
windows下的C++ socket服务器(4)
查看>>
css3 2d转换3d转换以及动画的知识点汇总
查看>>
【Java】使用Eclipse进行远程调试,Linux下开启远程调试
查看>>
对Vue为什么不支持IE8的解释之一
查看>>
计算机改名导致数据库链接的诡异问题
查看>>
Java8内存模型—永久代(PermGen)和元空间(Metaspace)(转)
查看>>
ObjectiveC基础教程(第2版)
查看>>
centos 引导盘
查看>>
Notes of Daily Scrum Meeting(12.8)
查看>>
Apriori算法
查看>>
onlevelwasloaded的调用时机
查看>>
求出斐波那契数组
查看>>
lr_start_transaction/lr_end_transaction事物组合
查看>>
CodeIgniter学习笔记(四)——CI超级对象中的load装载器
查看>>
.NET CLR基本术语
查看>>