AI-007: 吴恩达教授(Andrew Ng)的机器学习课程学习笔记27-33

本文是学习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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

铭记北宸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值