Classification and Logistic Regression
迪丽瓦拉
2025-05-28 19:57:47
0次

文章目录

  • 一、Classification: Probabilistic Generative Model
    • Ideal Alternatives
    • Two Boxes example
    • Two Classes
    • Gaussian Distribution
    • Probability from Class
    • Maximum Likelihood
    • Now we can do classification
    • Three Steps
  • 二、Classification: Logistic Regression
    • Step 1: Function Set
    • Step 2: Goodness of a Function
    • Step 3: Find the best function
    • Logistic Regression + Square Error
    • Generative v.s. Discriminative
    • Multi-class Classification
    • Limitation of Logistic Regression
  • 总结

一、Classification: Probabilistic Generative Model

Ideal Alternatives

Function (Model):
在这里插入图片描述
Loss function:
在这里插入图片描述
The number of times f get incorrect results on training data.

Find the best function:
Example: Perceptron, SVM

Classification as Regression?
Binary classification as example :
Training: Class 1 means the target is 1; Class 2 means the target is -1
Testing: closer to 1 → class 1; closer to -1 → class 2
在这里插入图片描述

Penalize to the examples that are “too correct”

Multiple class: Class 1 means the target is 1; Class 2 means the target is 2; Class 3 means the target is 3 …… problematic

Two Boxes example

在这里插入图片描述

From one of the boxes,where does it come from?
在这里插入图片描述

Two Classes

Estimating the Probabilities From training data
在这里插入图片描述
Given an x, which class does it belong to
在这里插入图片描述
在这里插入图片描述

Gaussian Distribution

在这里插入图片描述
Input: vector x, output: probability of sampling x
The shape of the function determines by mean μ and covariance matrix Σ
在这里插入图片描述

Probability from Class

在这里插入图片描述

Maximum Likelihood

在这里插入图片描述
在这里插入图片描述
The Gaussian with any mean μ and covariance matrix Σ can generate these points

在这里插入图片描述
Likelihood of a Gaussian with mean μ and covariance matrix Σ = the probability of the Gaussian samples x1,x2,x^3, …… ,x^79
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Now we can do classification

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
Testing data: 47% accuracy
All: hp, att, sp att,
de, sp de, speed (6 features)
在这里插入图片描述
Modifying Model:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

All: hp, att, sp att, de, sp de, speed

Three Steps

Function Set (Model):
在这里插入图片描述
Goodness of a function:
The mean μ and covariance Σ that maximizing the likelihood (the probability of generating data)
Find the best function: easy

Probability Distribution
在这里插入图片描述
Posterior Probability:
在这里插入图片描述

二、Classification: Logistic Regression

Step 1: Function Set

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Step 2: Goodness of a Function

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Step 3: Find the best function

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Logistic Regression + Square Error

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Generative v.s. Discriminative

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
Usually people believe discriminative model is better
Benefit of generative model
With the assumption of probability distribution
less training data is needed
more robust to the noise
Priors and class-dependent probabilities can be estimated from different sources.

Multi-class Classification

在这里插入图片描述
在这里插入图片描述

Limitation of Logistic Regression

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

总结

相关内容

热门资讯

AI做攻略、“双向奔赴”……国... 本文转自:人民网人民网记者 许维娜今年国庆假期,AI(人工智能)成了不少年轻人的“旅行搭子”。行前做...
合肥的这个“梗”, 翻篇了 社交平台的评论区,曾长期流传一句专属于合肥的黑色幽默。有人问合肥哪里好玩,本地网友半开玩笑地回复:合...
7万+旅游中高层都在的群,今天... 做旅游这行,资源卡位、渠道互通、项目落地——往往就差一个“对的机会”。我们的行业社群已聚集70,00...
一场帐篷音乐节,如何让井研从“... 帐篷音乐节现场封面新闻记者 周洪攀10月的研溪湿地,晚风里裹着柑橘的清甜与民谣的回响。夜幕降临,10...
白鹤翩翩落星愿,上海迪士尼度假... 10月9日,世界候鸟日前夕,上海迪士尼度假区星愿公园的湖风里多了一分白鹤的灵动。三座白鹤雕塑正式揭幕...
成都锦江边赏初秋枫叶飘飘 目前,成都锦江边国华街枫叶树红了。近年来,国华街附近的几条街都栽种了红枫树,是城区较集中看枫叶的点位...
GBTA:商务旅行正在复苏,但... 亚太正在成为全球商务旅行增长的重要引擎。在经历疫情后的快速反弹之后,全球商务旅行正在进入一个新的增长...
从景区焕新到节赛引流 邹城双节... 齐鲁网·闪电新闻10月9日讯 中秋、国庆“双节”假期,邹城市文化和旅游局提前谋划、周密部署,立足自身...
江山如此多娇 且看石楼今朝 金秋十月,黄河岸畔秋意盎然,丰收盛会喜迎国庆。本次石楼国庆文旅活动以“江山如此多娇,且看石楼今朝”为...
海南国庆假期接待游客475.4... 2026年国庆假期,海南接待游客475.40万人次,较2025年增长13.1%,较2024年增长15...