Basic theory

(i) Supervised learning (parametric/non-parametric algorithms, support vector machines, kernels, neural networks, )  regression, classification.
(ii) Unsupervised learning (clustering, dimensionality reduction, recommender systems, deep learning)
 
Others:
Reinforcement learning, recommender systems
 
SSE(和方差、误差平方和):The sum of squares due to error
 
MSE(均方差、方差):Mean squared error
 
RMSE(均方根、标准差):Root mean squared error
 
 
Linear regression
  • Gradient Descent algorithm:
 
     cost function:
  
  % correspoding code to compute gradient decent 
    h = X * theta;
    theta = theta - alpha/m * (X' * (h - y));
    
  • Normal Equation 标准方程/正规方程
 
Gradient Descent vs Normal Equation
time complexity for Gradient Decent is O(kn2) 
Locally weighted regression: 只考虑待预测点附件的training data
 
 
 
Logistic regression
 
    a classfication algorithm
 
 
Cost function:
 
 
 
 
 
  • Gradient Descent algorithm
          其中偏导数的推导如下:
       
 
Newton's method: much faster than Gradient Decent.
 
上图是求f(θ)=0时候的θ, 如果对f(θ)积分的最大值或者最小值
Newton’s method gives a way of getting to f(θ) = 0. What if we want to use it to maximize some function ℓ? The maxima of ℓ correspond to points where its first derivative ℓ ′ (θ) is zero. So, by letting f(θ) = ℓ ′ (θ), we can use the same algorithm to maximize ℓ, and we obtain update rule: 
θ := θ − ℓ ′(θ) / ℓ ′′(θ)
在python里,
 
 
Logistic Regression (Classification) decision boundary:
 

 

 
        
      
Neural Network
cost function:
 
           
          
back propagation algorithm:
 
 
  1. we can use Gradient checking to check if the backpropagation algorithm is working correctly.
  2. need randomly initialize theta
 
 
Diagnostic
Diagnostic 用来分析学习算法是不是正常工作,如果不正常工作,进一步找出原因
                       
怎么来评估learning algorithm 是否工作呢? 
 
可以评估hypothesis 函数, 具体可以把所以input数据分成一部分training set, 另一部分作为test set 来验证,Andrew 建议 70%/30% 这个比例来划分,然后看用training set 得到的hypothesis 在 test set 上是否工作
 
 
  • 一旦发现hypothesis 不工作,可以用model selection 来重新找hypothesis
 
  • 怎么确定 degree of polynomial (hypothesis方程的次数),
  1. 把input data 按照60/20/20% 分成3组 training set/ cross validation set/ test set
  2. 基于traing按照1-10 degree 先给出不同次数的hypothesis 函数,然后用cross validation set 实验不同次数的hypothesis方程, 得到最好结果的hypothesis
  3. 基于test set 可以给出 test report
 
  • 怎么确定 lamda (0, 0,01, 0,02, 0.04, 0.08, ..., 10)
 
 
 
  • Learning curves:
 
high bias:
 
high variance: (high gap)
 
If a learning algorithm is suffering from high bias, getting more training data will not (by itself) help much.
If a learning algorithm is suffering from high variance, getting more training data is likely to help.
 
  • How to upgrade your model?
 
  1. Getting more training examples: Fixes high variance
  2. Trying smaller sets of features: Fixes high variance
  3. Adding features: Fixes high bias
  4. Adding polynomial features: Fixes high bias
  5. Decreasing λ: Fixes high bias
  6. Increasing λ: Fixes high variance.
 
 
 
 
Unsupervised Learning   
 
Generative learning algo
 
 
 

Q&A

What is overfitting problem?
        
  1. How to reduce overfitting problem?
  • reduce the number of features
  • regularization. Keep all the features, but reduce the magnitude of parameters θ j
 
  1. besises Gradient Decent, what other algorithms we can use ?
  • besides Gradient Decent,  there are some optimization algorithms like Conjugate gradient, BFGS, L-BFGS.
  • These 3 optimization algorithms don't need maually pick , and they are often faster than Gradient Decent, but more
 
Reference:
 
 
Terms:
'parametric' learning algo
  • which has fixed set of parameters Theta, like linear regression
'non-parameter' learning algo
  • in which no. of parameters grow with m.
  • one specific algo is Locally weighted regression (Loess, or LWR), 这个算法不需要我们自己选feature,原理是只拟合待预测点附近的点的曲线
 
Discriminative algo: 对y建模 p(y|x)
Generative algo: 对x建模p(x|y)
 
GDA - Gaussian Discriminant Analysis,x 连续,y 不连续 
Naive Bayes - 比如垃圾邮件分类器,x 是不连续的,y 也是不连续的

Coursera, Machine Learning, notes的更多相关文章

  1. Coursera machine learning 第二周 quiz 答案 Linear Regression with Multiple Variables

    https://www.coursera.org/learn/machine-learning/exam/7pytE/linear-regression-with-multiple-variables ...

  2. 神经网络作业: NN LEARNING Coursera Machine Learning(Andrew Ng) WEEK 5

    在WEEK 5中,作业要求完成通过神经网络(NN)实现多分类的逻辑回归(MULTI-CLASS LOGISTIC REGRESSION)的监督学习(SUOERVISED LEARNING)来识别阿拉伯 ...

  3. 【Coursera - machine learning】 Linear regression with one variable-quiz

    Question 1 Consider the problem of predicting how well a student does in her second year of college/ ...

  4. Coursera, Machine Learning, Anomoly Detection & Recommender system

      Algorithm:     When to select Anonaly detection or Supervised learning? 总的来说guideline是如果positive e ...

  5. Coursera, Machine Learning, SVM

    Support Vector Machine (large margin classifiers ) 1. cost function and hypothesis 下面那个紫色线就是SVM 的cos ...

  6. Coursera, Machine Learning, Neural Networks: Representation - week4/5

    Neural Network Motivations 想要拟合一条曲线,在feature 很多的情况下,feature的组合也很多,在现实中不适用,比如在computer vision问题中featu ...

  7. Coursera machine learning 第二周 编程作业 Linear Regression

    必做: [*] warmUpExercise.m - Simple example function in Octave/MATLAB[*] plotData.m - Function to disp ...

  8. Coursera machine learning 第二周 quiz 答案 Octave/Matlab Tutorial

    https://www.coursera.org/learn/machine-learning/exam/dbM1J/octave-matlab-tutorial Octave Tutorial 5  ...

  9. Coursera Machine Learning 作业答案脚本 分享在github上

    Github地址:https://github.com/edward0130/Coursera-ML

随机推荐

  1. Apache Beam实战指南 | 手把手教你玩转KafkaIO与Flink

    https://mp.weixin.qq.com/s?__biz=MzU1NDA4NjU2MA==&mid=2247492538&idx=2&sn=9a2bd9fe2d7fd6 ...

  2. 对PDF的操作

    PDF是个常见的格式,当我们需要对PDF做操作时,可以主要利用PDFbox和itext.这里主要介绍PDfbox,itext自己去 查找资料.添加pom配置. <dependency> & ...

  3. Keyboard Hook API函数 参数说明

    来源:https://www.cnblogs.com/grenet/archive/2010/12/07/1898840.html 1.Keyboard的HOOK函数分为两种,WH_KEYBOARD_ ...

  4. VMware Workstation 14 激活码

    激活码: 1.FF31K-AHZD1-H8ETZ-8WWEZ-WUUVA 2.CV7T2-6WY5Q-48EWP-ZXY7X-QGUWD

  5. long long

    1. ll a; scanf("%d",&a); 数据读入后,产生错误 2. const ll inf=1e18; 3. int * ll = ll ll * int = ...

  6. java利用线程池处理集合

    java利用线程池处理集合 2018年07月23日 17:21:19 衍夏成歌 阅读数:866   版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/s ...

  7. spring的设计模式

    spring中用到哪些设计模式   1.工厂模式,这个很明显,在各种BeanFactory以及ApplicationContext创建中都用到了: 2.模版模式,这个也很明显,在各种BeanFacto ...

  8. mysql视图、触发事务、存储过程

    视图 视图是一个虚拟表(非真实存在的),其本质就是根据SQL语言获取动态的数据集,并为其命名,用户使用时只需要使用名称即可获得结果集,可以将结果集当做表来使用. 视图是存在数据库中的,如果我们程序中使 ...

  9. JVM高手之路七(tomcat调优以及tomcat7、8性能对比)

         版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/lirenzuo/article/details/77164033 因为每个链路都会对其性能 ...

  10. python学习笔记——字典操作

    修改 a={'add':"shanghao","name":"zhangdong"} a['name']='zhangsan' 添加 a={ ...