Coursera, Machine Learning, notes
Basic theory
|
Linear regression
|
cost function:
![]() % correspoding code to compute gradient decent
h = X * theta;
theta = theta - alpha/m * (X' * (h - y));
![]() 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:
![]() ![]() ![]()
其中偏导数的推导如下:
![]() ![]() |
|
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里,
![]() |

|
Neural Network
|
|
cost function:
|
|
back propagation algorithm:
![]() ![]() ![]() |
|
|
Diagnostic
|
|
Diagnostic 用来分析学习算法是不是正常工作,如果不正常工作,进一步找出原因
|
|
怎么来评估learning algorithm 是否工作呢?
可以评估hypothesis 函数, 具体可以把所以input数据分成一部分training set, 另一部分作为test set 来验证,Andrew 建议 70%/30% 这个比例来划分,然后看用training set 得到的hypothesis 在 test set 上是否工作
![]() |
high bias:
high variance: (high gap)
|
Q&A
- How to reduce overfitting problem?
- reduce the number of features
- regularization. Keep all the features, but reduce the magnitude of parameters θ j
- 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
- which has fixed set of parameters Theta, like linear regression
- in which no. of parameters grow with m.
- one specific algo is Locally weighted regression (Loess, or LWR), 这个算法不需要我们自己选feature,原理是只拟合待预测点附近的点的曲线
Coursera, Machine Learning, notes的更多相关文章
- Coursera machine learning 第二周 quiz 答案 Linear Regression with Multiple Variables
https://www.coursera.org/learn/machine-learning/exam/7pytE/linear-regression-with-multiple-variables ...
- 神经网络作业: NN LEARNING Coursera Machine Learning(Andrew Ng) WEEK 5
在WEEK 5中,作业要求完成通过神经网络(NN)实现多分类的逻辑回归(MULTI-CLASS LOGISTIC REGRESSION)的监督学习(SUOERVISED LEARNING)来识别阿拉伯 ...
- 【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/ ...
- Coursera, Machine Learning, Anomoly Detection & Recommender system
Algorithm: When to select Anonaly detection or Supervised learning? 总的来说guideline是如果positive e ...
- Coursera, Machine Learning, SVM
Support Vector Machine (large margin classifiers ) 1. cost function and hypothesis 下面那个紫色线就是SVM 的cos ...
- Coursera, Machine Learning, Neural Networks: Representation - week4/5
Neural Network Motivations 想要拟合一条曲线,在feature 很多的情况下,feature的组合也很多,在现实中不适用,比如在computer vision问题中featu ...
- Coursera machine learning 第二周 编程作业 Linear Regression
必做: [*] warmUpExercise.m - Simple example function in Octave/MATLAB[*] plotData.m - Function to disp ...
- Coursera machine learning 第二周 quiz 答案 Octave/Matlab Tutorial
https://www.coursera.org/learn/machine-learning/exam/dbM1J/octave-matlab-tutorial Octave Tutorial 5 ...
- Coursera Machine Learning 作业答案脚本 分享在github上
Github地址:https://github.com/edward0130/Coursera-ML
随机推荐
- A1124. Raffle for Weibo Followers
John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers ...
- 【洛谷P2868】Sightseeing Cows
题目大意:给定一个 N 个点,M 条边的有向图,点有点权,边有边权,求该有向图中的一个环,使得环上点权和与环上边权和之比最大. 题解:0/1 分数规划思想,每次二分一个 mid,在新图上跑 spfa, ...
- Django(十五)Form组件
参考博客: https://www.cnblogs.com/haiyan123/p/7778888.html http://www.cnblogs.com/wupeiqi/articles/61441 ...
- SNP在世界地图上的频率分布
简单介绍两个网页工具,第一个是GGV,其界面如下: 第二个工具是HGDP,个人感觉画出来有点丑..都是同一所大学开发出来的:界面如下:
- redis的操作
redis相当于是一个在内存中创建的大字典 redis的value有5大数据类型: redis的value有5大数据类型: 字符串 import redis conn = redis.Redis(ho ...
- 编写一个数组工具类, 编写本软件的 帮助文档(API文档)
本文档是对静态成员的练习. 一. 建立一个ArrayTool(数组工具)的类,在此类中对传入数组进行一些操作(选最大值.先最小值.冒泡排正序.选择排反序.输出数组元素), 二. 建立一个Test的类, ...
- Luogu P3239 [HNOI2015]亚瑟王
题目链接 \(Click\) \(Here\) 期望神题.最开始一直尝试推朴素一点的,逻辑上的\(DP\)式子,后来发现一直出锅,可能是我的式子没容斥对... 题解中给出的想法是这样的: 首先,如果直 ...
- aspcms逻辑错误导致后台地址泄露
访问即可跳转后台地址: URL:http://www.xxx.org.cn/plug/oem/AspCms_OEMFun.asp 注入:plug/comment/commentList.asp?id= ...
- (转载)python: getopt的使用;
注: 该文转载于https://blog.csdn.net/tianzhu123/article/details/7655499python中 getopt 模块, 该模块是专门用来处理命令行参数的 ...
- 如何优雅地使用Sublime Text3
此文非原创,出处见文章结尾. 一.Sublime Text 3插件安装 优雅使用Sublime Text,插件则是不可缺少的存在:而插件的备份就显得非常的重要(譬如:各平台同步:更换系统/电脑,迅速使 ...



















