AI-004: 吴恩达教授(Andrew Ng)的机器学习课程学习笔记1-14

本文是学习Andrew Ng的机器学习系列教程的学习笔记。教学视频地址:

https://study.163.com/course/introduction.htm?courseId=1004570029#/courseDetail?tab=1

本文中的白色背景视频截图来自Andrew Ng的视频脚程, 思维导图为原创总结。

ML基础介绍,单变量的线性回归:

  1. Introduce

    ML: grew out of work in AI, new capability for computers;

    Examples:

                -database mining

                            large datasets from growth of automation/web.

                            e.g.: web click data, medical records, biology, engineering

                -Application can’t program by hand.

                            e.g.: autonomous helicopter, handwriting recognition, most of NLP,

     

    Computer Vision

                -self-customizing programs

                            e.g.:, Amazon, Netflix product recommendations

                -Understanding human learning (brain, real AI).

  2. What's ML
     

    Arthur Samuel(1959): learning without being explicitly programmed

    Tom Mitchell(1998): experience E, task T, performance measure P, performance on T, as measured by P, improves with experience E.

    Spam email:

               

     

    ML learning algorithms:

    -Major tow: supervised learning/ unsupervised learning

    -Others: reinforcement learning, recommender systems

  3. Introduction supervised learning

    Regression problem 归问题

    Deal continuous value

     

    Classification problem 类问题

    Deal with discrete values

    How to allow computer to deal with an infinite number of features.

  4. Introduction unsupervised learning

    No label data, find some structure, deal clustering

    just like google news, cluster news topic

    like genes analogy
     

    Used to :

    -organize computing clusters

    -social network analysis

    -market segmentation

    -astronomical data analysis

     

    also used to :

    -cocktail party problem

     

    Used to first build algorithm prototype in Octave

    When this algorithm work, will migrate it to C++ or Java

    总结:

  5. Linear regression with one variable - model representation

    some sym:

    m = Number of training examples

    x’s = ‘input’ variable/features

    y’s = ‘output’ variable /’target’ variable

    (x, y) = one training example

    (xi, yi) = the ith training example


     

  6. Linear regression with one variable - Cost function
     

     

    cost function to find the minimize feature.

    The normal cost function is squared error function. MSE – Mean-Square Error
    Others: RMSE MAE R-Squared

  7. Linear regression with one variable - Cost function intuition
    首先简化问题,减少特征,图形化假设函数及成本函数

    try Ø to h Ø (x), and J(Ø)

     
    然后看看两个特征量的假设函数和成本函数的图形化分析(碗形图和等高线图):

    Bowl like shape

    Contour plots

  8. Linear regression with one variable - Gradient descent


     

    := assignment, = truth assertion

    ∂ learning rate

    梯度下降,下降是指将特征的值进行修改,每次修改的大小是学习效率与对成本函数中的特征求偏导的乘积,这样的到的新特征的值带入成本函数,如果能降低成本函数值(即减少偏差),就认为接近我们的目标了。
     

     

     

    can use gradient descent to minimize any cost function J.

    Gradient descent + cost function to get an algorithm for linear regression

    Get partial derivatives of θ0θ1
     

    Cost function of one variable linear regression is Convex function(bowl shape), have no local optimum and only have global optimum.

    this gradient descent function called Batch : Each step of gradient descent uses all the training example.

    总结:

  9. Linear Algebra review - Matrices and vectors
    为了将简单的线性回归(一个特征)扩展到多个特征,首先要具备一些线性代数的知识。
    Matrix – Rectangular array of numbers

     

    张量Tensor

    张量是一组数字,排列在一个规则的网格上,具有不同数量的轴。张量有三个指标,第一个指向行,第二个指向列,第三个指向轴。例如,V232指向第二行,第三列和第二个轴。这指的是右图张量中的值0,如下图所示:

     

    Upper case used to refer to a matrix, and lower case used to refer to either numbers or just raw numbers or scalars or vectors.

  10.  

    Linear Algebra review - Addition and scalar multiplication
     

     

    Matrix Addition

    Scalar multiplication:

     

  11. Linear Algebra review - Matrix-vector multiplicaation
     

     

    change problem to matrix times vectors

    can use one line in Octave

    can simplify the code and more efficient

  12. Linear Algebar review - matrix-matrix multiplication
    First matrix’s column number = second matrix’s row number

    Am*n, Bn*o, A*B果是矩Cm*o,即所得矩的行列数量分等于A的行数与B阵的列数
    房价估计问题用矩阵表示会更精炼些:

     

    By constructing these two matrices, can apply three hypotheses to all four house sizes.

    To get all twelve predicted prices output.

  13. Linear Algebra review - matrix multiplication properties
    Matrix multiplication is not commutative
     

    matrix multiplication is associative

    Identity matrix 位矩 is commutative

    充:
    1.

    量乘法是可交的,但不是矩乘法。意味着当我乘以7 * 33 * 7相同。但是当我将矩彼此相乘A * BB * A不一

    2.

    量和矩乘法都是关的。意味着量乘35 * 3)与(3 * 53相同并且矩AB * C)与(A * BC相同。

    3.分配

    量和矩乘法也是分布式的。意味着35 + 3)与3 * 5 + 3 * 3相同,并且AB + C)与A * B + A * C相同。

    4.位矩

    位矩是一种特殊的矩,但首先,我需要定什么是位。数字1是一个位,因你与1相乘的所有西都等于它自己。因此,与位矩相乘的每个矩都等于它自己。例如,矩A乘以其位矩等于A.

    你可以通以下事发现单位矩:它沿线有一个,而其他每个零。它也是一个“平方矩”,意思是它的行数与列数相匹配。

  14. Linear Algebra review - inverse and transpose
     

    Inverse 逆运算

    Transpose

    Only square matrices have inverses. Mean rows = columns -> square matrices. Am*m

    Matrices that don’t have an inverse are ‘singular’ or ‘degenerate’

    Singular matrix奇异矩

    Degenerate matrix 退化矩

    Transpose - flip the matrix along that 45 degree axis

    Aij = Bji

     

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

铭记北宸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值