当前位置:网站首页>3.2 - classification - Logistic regression
3.2 - classification - Logistic regression
2022-08-11 07:51:00 【A big boa constrictor 6666】
文章目录
一、函数集合(Function Set)
- 后验概率(Posterior probability):P(x)就是后验概率,右图是P(x)的图解,The whole process is also known as logistic regression(Logistic Regression)
二、better function(Goodness of a Function)
- 最好的w*和b*It is the training set that has the greatest probability of generating this training setw和b,The figure on the right is a simplified operation after the identity deformation of the formula.
- The blue lines are the two Bernoulli distributions(Bernoulli distribution)的交叉熵(Cross entropy),The cross entropy is used to calculate the two distributionsp和qhow close to each other,如果p和q一模一样的话,Then the final calculated cross entropy is 0
- 对于逻辑回归(Logistic Regression)而言,It is used to measure the quality of the modellossThe function is the sum of the cross-entropy over the training set.该值越小,The better the performance on the training set.
三、Find the best function(Find the best function)
- 对lossfunction to simplify,The final result is shown in green on the right,When the gap between the output of the model and the expected value is larger,Then the amount of our update should be larger
- We can see from the left image,Logistic regression and linear regression work in the same way when doing parameter updates,You just need to adjust the learning rate η \eta η
- According to the figure below, it can be clearly seen that variance is used when doing logistic regression(SquareError)来做loss函数的弊端,far from the optimal solution,Its differential value is still very small,This is not good for us to do gradient descent.

- Logistic regression is a discriminant method(Discriminative),Unlike the probabilistic generative model in the previous chapter, it is a generative method(Generative).
- Although both methods are looking for the best model in the same set of functions,But since logistic regression is found by doing gradient descent directlyw和b,Probabilistic generative models are created by finding𝜇1, 𝜇2, Σcome to findw和b,采取的方法不同,Therefore, the final model will also be very different.
- In the example of Pokémon,We found that logistic regression is better than probabilistic generative models.
- In the example below it is easy to intuit that the test set belongsclass 1的,However naive Bayes classifiers in probabilistic generative models end up telling us where the test set came fromclass 2.这是为什么呢?
- This is because in the Naive Bayes classifier,It never considers correlations between different dimensions(correlation),It considers that the two-dimensional parameters in each of the following data are independent of each other.Because probabilistic generative models always make some assumptions,For example, suppose that the data comes from a probability distribution,It's like it's brainstorming something,
四、Advantages of probabilistic generative models
- Logistic regression is more affected by the data,Because he doesn't make any assumptions,So its error will decrease as the amount of data increases
- Probabilistic generative models are less affected by the data,Because he has an assumption of his own,Sometimes it ignores thatdata,And follow that assumption of its own heart.因此在数据量比较小的时候,It is possible for probabilistic generative models to outperform logistic regression.
- when the dataset is noisy,For example, part of the label is wrong,Because the probability generation model is less affected by the data,Then the final result may filter out these bad factors.
- 以语音辨识为例,Although a neural network is used,This is a logistic regression method.但事实上,The whole system is a probabilistic generative model,DNNJust a piece of it.
五、多分类
- SoftmaxIt means maximum reinforcement,Because a layer of index is passed in the middle(exponential)operation to amplify the gap between the outputs.
逻辑回归的限制(Limitation of Logistic Regression):
Here's the problem that logistic regression can't solve,We need to perform a certain feature transformation(Feature Transformation)
- 特征变换(Feature Transformation):In order to allow the machine to generate transformations autonomously(Transformation)规则,We can join multiple logistic regressions(Cascading)起来.The figure on the right nicely shows the two processes of feature transformation and classification.
- The box in the middle of the last picture is a class of neurons(Neuron),And this whole network is called a neural network(Neural Network),也被称为深度学习(Deep Learning)

边栏推荐
- Discourse 的关闭主题(Close Topic )和重新开放主题
- 机器学习总结(二)
- TF中的One-hot
- 2022年中国软饮料市场洞察
- 从何跟踪伦敦金最新行情走势?
- Taobao product details API interface
- 关于Android Service服务的面试题
- Redis source code-String: Redis String command, Redis String storage principle, three encoding types of Redis string, Redis String SDS source code analysis, Redis String application scenarios
- Production and optimization of Unity game leaderboards
- 1056 Sum of Combinations (15 points)
猜你喜欢
【Pytorch】nn.Linear,nn.Conv
1002 Write the number (20 points)
详述 MIMIC护理人员信息表(十五)
Strongly recommend an easy-to-use API interface
求职简历这样写,轻松搞定面试官
tf.reduce_mean()与tf.reduce_sum()
1051 Multiplication of Complex Numbers (15 points)
6月各手机银行活跃用户较快增长,创半年新高
Discourse's Close Topic and Reopen Topic
Douyin API interface
随机推荐
How Unity programmers can improve their abilities
如何选择专业、安全、高性能的远程控制软件
1076 Wifi密码 (15 分)
2.1-梯度下降
Item 2 - Annual Income Judgment
NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
LeetCode刷题系列 -- 46. 全排列
TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
C语言每日一练——Day02:求最小公倍数(3种方法)
1036 跟奥巴马一起编程 (15 分)
Pico neo3在Unity中的交互操作
tf.reduce_mean()与tf.reduce_sum()
关于Excel实现分组求和最全文档
Taobao product details API interface
How Unity handles C# under the hood
Pico neo3 Unity打包设置
3.1-分类-概率生成模型
1003 I want to pass (20 points)
2022年中国软饮料市场洞察
结合均线分析k线图的基本知识