Coursera吴恩达机器学习课程笔记第一周——机器学习介绍和matlab的优点

周 1 Introduction

2019年7月23日

视频:Unsupervised Learning

使用机器学习方法 可以非常简单地通过无监督聚类分离出两个人的说话声音、人和音乐的声音;

为什么使用Octave软件或者mtlab软件?

可以快速地实现某一个算法,而不需要编写大量的代码(如果使用C++或者java 很多简单的算法需要写非常多的代码)

一般使用Octave或者matlab之类的软件快速开发出算法原型,确定可以使用的时候才会迁移到其他的编译环境(把比如c或者java)。事实上,这样做的效率要比直接使用C来开发要快得多

推荐使用Octave 可以更快速地学习

无监督学习的例子:对文章进行自动分类、通过客户数据发现细分市场

监督学习的例子:是否是垃圾邮件?是否有肿瘤?

2019年7月24日

1.什么是机器学习

Tom Mitchell provides a more modern definition: “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.”

总的来说,任何机器学习任务都可被分为两类:监督学习和非监督学习

2.监督学习

In supervised learning, we are given a data set and already know what our correct output should look like, having the idea that there is a relationship between the input and the output.

回归或者分类:

(a) Regression - Given a picture of a person, we have to predict their age on the basis of the given picture

(b) Classification - Given a patient with a tumor, we have to predict whether the tumor is malignant or benign.

To describe the supervised learning problem slightly more formally, our goal is, given a training set, to learn a function h : X → Y so that h(x) is a “good” predictor for the corresponding value of y. For historical reasons, this function h is called a hypothesis. Seen pictorially, the process is therefore like this:

Coursera吴恩达机器学习课程笔记第一周——机器学习介绍和matlab的优点

3.无监督学习

Unsupervised learning allows us to approach problems with little or no idea what our results should look like. We can derive structure from data where we don’t necessarily know the effect of the variables.

We can derive this structure by clustering the data based on relationships among the variables in the data.

With unsupervised learning there is no feedback based on the prediction results.

例子:

Example:

Clustering 聚类: Take a collection of 1,000,000 different genes, and find a way to automatically group these genes into groups that are somehow similar or related by different variables, such as lifespan, location, roles, and so on.

Non-clustering非聚类: The “Cocktail Party Algorithm”, allows you to find structure in a chaotic environment. (i.e. identifying individual voices and music from a mesh of sounds at a cocktail party).

4.损失函数

contour plot 轮廓图–>可以用来可视化地呈现损失函数

A contour plot is a graph that contains many contour lines. (包含许多轮廓线)A contour line of a two variable function has a constant value at all points of the same line.(同一个轮廓线上的所有点的函数值相同) An example of such a graph is the one to the right below.

Coursera吴恩达机器学习课程笔记第一周——机器学习介绍和matlab的优点
Coursera吴恩达机器学习课程笔记第一周——机器学习介绍和matlab的优点

Coursera吴恩达机器学习课程笔记第一周——机器学习介绍和matlab的优点在轮廓图中离中心更近,同时损失函数的误差也得到了降低

Coursera吴恩达机器学习课程笔记第一周——机器学习介绍和matlab的优点

The graph above minimizes the cost function as much as possible and consequently, the result of θ1 and θ0 tend to be around 0.12 and 250 respectively. Plotting those values on our graph to the right seems to put our point in the center of the inner most ‘circle’.

当尽可能地最小化误差函数的时候,相应的点画在轮廓图中看起来就好像在众多“圆”的中心