本文是学习Andrew Ng的机器学习系列教程的学习笔记。教学视频地址:
https://study.163.com/course/introduction.htm?courseId=1004570029#/courseDetail?tab=1
分类问题思维导图:
27. Logistic Regression - Classification
Example:
It is not good to use linear regression to solve classification problem.
Threshold阈值
28. Logistic Regression - Hypothesis representation
通过逻辑函数将线性变化转变为状态变化,只有0、1两个结果,假设函数就是获得这两个结果的概率,且概率和为1。
Logistic regression is a classify problem.
Sigmoid function = Logistic function:
29. Logic Regression - Decision boundary
The decision boundary is a property of the hypothesis, including the parameters θ1 θ2 θ3
No data the decision boundary is also there
根据训练数据分布,估计拟合函数图形,比如椭圆:x^2+^2 = 1
Long as we’ve given my parameter vector θ, that defines the decision boundary which is the circle.
The training set no use to decide the decision boundary, it may used to fit the parameters θ.
If I have even higher order polynomial terms, I Can get very complex decision boundaries.
Higher order polynomial terms 高阶多项式
Decision boundary 决策边界
30. Logistic Regression - Cost function
通过引入更复杂函数,构造凹函数作为成本函数。
Problem:
superscript 上标
Cost function in linear regression:
used in logistic regression will get non-convex function, try to find a convex function:
non-convex 非凸函数
Cost function in Logistic regression:
31. Logistic Regression - Simplified cost function and gradient descent
Both cost function show in one:
有了成本函数,就可以通过求成本函数的最小值来确定参数。
maximum likelihood estimation极大似然估计法
32. Logistic Regression - Advanced optimization
In octave create cost function:
set options and run fminunc:
33. Logistic regression - Mult-class classification: One-vs-all
What is multi-class classification problem?
change multi to one, and use more classifiers h(x):
Do prediction: just put x in each classifier, and pick the most confident or most enthusiastically
Train a logistic regression classifier for each class i to predict the probability that y = i.
On a new input x, to make a prediction, pick the class I that maximizes.