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
随机推荐
- js 打开标签
JS打开新标签的2种方式 1.超链接<a href="http://www.jb51.net" title="脚本之家">Welcome</a ...
- 系统API执行没效果,可以检查一下是否与 360安全卫士 有关?!
今天在写一个工具软件,使用到一个系统API: mouse_event() 代码如下: mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, x2, ...
- 在html页面通过js实现复制粘贴功能
前言:要实现这个功能,常用的方式大概分为两类,第一种就是上插件,这个网上有大把,第二种就是直接用几行JS来实现. 这次说第二种实现方式,这方式有很大的局限性,只能用表单元素,并且不能设置disable ...
- python常用的内置模块
1.import time time模块与时间相关的功能 在python中时间分为3种 1.时间戳timestamp从1970 1月 1日到现在的秒数 主要用于计算两个时间的差 2.localtime ...
- collections和collection 还有集合
概述 一个集合,即collection,有时也被称为一个容器,是将多个元素聚集成一个单元的对象.Collections常被用来存储.检索.操纵聚集数据以及聚集数据间的通信.一般来说,Collectio ...
- JSP页面用<a>标签访问 Action 出错
问题: JSP页面 <a href="/crud1/crud1/add.action" >添加</a> struts.xml 中: <package ...
- (去重 sort)nyoj8-一种排序
8-一种排序 内存限制:64MB 时间限制:3000ms 特判: No通过数:235 提交数:749 难度:3 题目描述: 现在要求按照以下方式排序(默认排序都是从小到大) 现在有很多长方形,每一个长 ...
- 关于web-root和web-inf的用处
web-inf下的页面不能直接反问,必须通过servlet页面进行跳转,安全性高. web-root下的页面能直接通过地址栏来访问,安全性低. 哪些页面放在web-root下,哪些放在web-inf下 ...
- python3: 爬虫---- urllib, beautifulsoup
最近晚上学习爬虫,首先从基本的开始: python3 将urllib,urllib2集成到urllib中了, urllib可以对指定的网页进行请求下载, beautifulsoup 可以从杂乱的ht ...
- ADB interface驱动
原文地址:https://blog.csdn.net/weixin_42108952/article/details/80153402



















