https://www.coursera.org/learn/machine-learning/exam/dbM1J/octave-matlab-tutorial Octave Tutorial 5 试题 1. Suppose I first execute the following Octave commands: A = [1 2; 3 4; 5 6]; B = [1 2 3; 4 5 6]; Which of the following are then valid Octave com…
https://www.coursera.org/learn/machine-learning/exam/7pytE/linear-regression-with-multiple-variables 1. Suppose m=4 students have taken some class, and the class had a midterm exam and a final exam. You have collected a dataset of their scores on the…
必做: [*] warmUpExercise.m - Simple example function in Octave/MATLAB[*] plotData.m - Function to display the dataset[*] computeCost.m - Function to compute the cost of linear regression[*] gradientDescent.m - Function to run gradient descent 1.warmUpE…
Machine Learning – Coursera Octave for Microsoft Windows GNU Octave官网 GNU Octave帮助文档 (有900页的pdf版本) Octave 4.0.0 安装 win7(文库) Octave学习笔记(文库) octave入门(文库) WIN7 64位系统安装JDK并配置环境变量(总是显示没有安装Java) MathWorks This week we're covering linear regression with mul…
1.Introduction 1.1 Example        - Database mining        Large datasets from growth of automation/web.        E.g., Web click data, medical records, biology, engineering        - Applications can't program by hand.        E.g., Atonomous helicopter…
第二周:神经网络的编程基础 (Basics of Neural Network programming) 2.1.二分类(Binary Classification) 二分类问题的目标就是习得一个分类器,它以图片的特征向量(RGB值的矩阵,最后延展成一维矩阵x,如下)作为输入,然后预测输出结果…
Github地址:https://github.com/edward0130/Coursera-ML…
  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, dee…
评估性能 评估损失 1.Training Error 首先要通过数据来训练模型,选取数据中的一部分作为训练数据. 损失函数可以使用绝对值误差或者平方误差等方法来计算,这里使用平方误差的方法,即: (y-f(x))2 使用此方法计算误差,然后计算所有数据点,并求平均数. Training Error 越小,模型越好?答案是否定的,下面看看Training Error 和模型复杂度的关系. 从上的的图可以看出,要想使training error越小,模型就会变得越复杂,然后出现了过拟合的现象 很有可…
多元回归 回顾一下简单线性回归:一个特征,两个相关系数 实际的应用要比这种情况复杂的多,比如 1.房价和房屋面积并不只是简单的线性关系. 2.影响房价的因素有很多,不仅仅是房屋面积,还包括很多其他因素. 现在描述第一种情况,房价和房屋面积不只是简单的线性关系,可能是二次或者多项式: 二次函数: 多项式函数: 多项式回归: 这里的特征都是通过房屋面积这个自变量得到的. 第二种情况,影响房屋价格的因素不仅仅是房屋面积,这里增加了卧室的数量.这种就是多元线性回归. 通用表达式: 多元线性回归中,理解相…
在WEEK 5中,作业要求完成通过神经网络(NN)实现多分类的逻辑回归(MULTI-CLASS LOGISTIC REGRESSION)的监督学习(SUOERVISED LEARNING)来识别阿拉伯数字.作业主要目的是感受如何在NN中求代价函数(COST FUNCTION)和其假设函数中各个参量(THETA)的求导值(GRADIENT DERIVATIVE)(利用BACKPROPAGGATION). 难度不高,但问题是你要习惯使用MATLAB的矩阵QAQ,作为一名蒟蒻,我已经狗带了.以下代核心…
Question 1 Consider the problem of predicting how well a student does in her second year of college/university, given how well they did in their first year. Specifically, let x be equal to the number of "A" grades (including A-. A and A+ grades)…
  Algorithm:     When to select Anonaly detection or Supervised learning? 总的来说guideline是如果positive example (anomaly examples)特别少就用Anamaly detection. 如果数据positive example 越来越多,可以选择从Anomanly detection 切换到 Supervised learning.     怎么选择feature ?   可以先画出f…
Support Vector Machine (large margin classifiers ) 1. cost function and hypothesis 下面那个紫色线就是SVM 的cost function       2. SVM 的数学解释                           3. SVM with kernel 我的理解是 kernel 的作用就是把低维度的 x 转化成高维的 f, 然后就好分类了   note: 上图就是一个2维(x1, x2)变3维(f1,…
Neural Network Motivations 想要拟合一条曲线,在feature 很多的情况下,feature的组合也很多,在现实中不适用,比如在computer vision问题中feature就太多了. Applications cost function and BP                 Gradient Checking https://www.coursera.org/learn/machine-learning/supplement/pjdBA/backpropa…
逻辑回归代价函数(损失函数)的几个求导特性 1.对于sigmoid函数 2.对于以下函数 3.线性回归与逻辑回归的神经网络图表示 利用Numpy向量化运算与for循环运算的显著差距 import numpy as np import time ar = np.array([[1,2,3],[4,5,6]] a1 = np.random.rand(10000000) a2 = np.random.rand(10000000) t1 = time.time() np.dot(a1,a2) c = 0…
1.import 模块 import os import tarfile from six.moves import urllib import pandas as pd pd.set_option('display.width', None) import matplotlib.pyplot as plt import numpy as np import hashlib 2.获取数据模块 DOWNLOAD_ROOT = "https://raw.githubusercontent.com/a…
简单回归 这里以房价预测作为例子来说明:这里有一批关于房屋销售记录的历史数据,知道房价和房子的大小.接下来就根据房子的大小来预测下房价. 简单线性回归,如下图所示,找到一条线,大体描述了历史数据的走势. f(x) 代表房价的预测值 wo 代表截距(intercept) 相关系数 w1 代表特征(房子大小)的相关系数(coefficient) x 代表房子的大小 yi 代表房价真实值 xi 代表房子大小的真实值 εi 代表真实值与预测值之间的误差 已知x,只要求出wo和w1就能简单的对房价进行预测…
有用的链接: http://blog.csdn.net/yunlong34574/article/details/8851942…
- Normal equation 到眼下为止,线性回归问题中都在使用梯度下降算法,但对于某些线性回归问题,正规方程方法是更好的解决方式. 正规方程就是通过求解例如以下方程来解析的找出使得代价函数最小的參数: 如果我们的训练集特征矩阵为X,我们的训练集结果为向量y,则利用正规方程解出向量: 下面表所看到的的数据为例: 运用正规方程方法求解參数为: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvam9qb3poYW5nanU=/font/5a6L5L2T…
Clustering  K-means: 基本思想是先随机选择要分类数目的点,然后找出距离这些点最近的training data 着色,距离哪个点近就算哪种类型,再对每种分类算出平均值,把中心点移动到平均值处,重复着色算平均值,直到分类成功.   为了防止k-means 算法得到的是local optima, 可以多次运行k-means, 然后选取得到J最小值的那次初始化方法.     One way to choose K is elbow method   Dimentionality Re…
Uninstall any existing gnuplot on your OSX brew uninstall gnuplot Install gnuplot with either X or X11 brew-install gnuplot --with-x11 Finally, set the GNUTERM to X11 setenv("GNUTERM","X11") 或者 brew install gnuplot --with-qt setenv(&qu…
https://www.quora.com/How-do-I-learn-machine-learning-1?redirected_qid=6578644   How Can I Learn X? Learning Machine Learning Learning About Computer Science Educational Resources Advice Artificial Intelligence How-to Question Learning New Things Lea…
About this Course Machine learning is the science of getting computers to act without being explicitly programmed. In the past decade, machine learning has given us self-driving cars, practical speech recognition, effective web search, and a vastly i…
https://jmetzen.github.io/2015-01-29/ml_advice.html Advice for applying Machine Learning This post is based on a tutorial given in a machine learning course at University of Bremen. It summarizes some recommendations on how to get started with machin…
机器学习实战 (豆瓣) https://book.douban.com/subject/24703171/ 机器学习是人工智能研究领域中一个极其重要的研究方向,在现今的大数据时代背景下,捕获数据并从中萃取有价值的信息或模式,成为各行业求生存.谋发展的决定性手段,这使得这一过去为分析师和数学家所专属的研究领域越来越为人们所瞩目. 本书第一部分主要介绍机器学习基础,以及如何利用算法进行分类,并逐步介绍了多种经典的监督学习算法,如k近邻算法.朴素贝叶斯算法.Logistic回归算法.支持向量机.Ada…
第二周 第一部分 Multivariate Linear Regression Multiple Features Note: [7:25 - θT is a 1 by (n+1) matrix and not an (n+1) by 1 matrix] Linear regression with multiple variables is also known as "multivariate linear regression". We now introduce notatio…
In Week 6, you will be learning about systematically improving your learning algorithm. The videos for this week will teach you how to tell when a learning algorithm is doing poorly, and describe the 'best practices' for how to 'debug' your learning…
Logistic regression is a method for classifying data into discrete outcomes. For example, we might use logistic regression to classify an email as spam or not spam. In this module, we introduce the notion of classification, the cost function for logi…