当前位置:网站首页>Classification model - logistic regression, Fisher linear discriminant (SPSS)
Classification model - logistic regression, Fisher linear discriminant (SPSS)
2022-07-23 23:07:00 【Wolves_ YY】
This article draws on mathematical modeling Teacher Qingfeng's courseware and ideas , You can click the view link to view the video explanation of teacher Qingfeng : Qingfeng mathematical modeling :https://www.bilibili.com/video/BV1DW411s7wi
One 、 Dichotomous problem
1.0 Case study
1.0.1 Case background

1.0.2 Case data

1.1 Logical regression
With the help of SPPSS The steps to realize logical regression are as follows :
Import data into SPSS, Here's the picture :

Then create a dummy variable for the dependent variable type (01 Variable ), Here's the picture :

After creation, a new 3 Column , Framed for their differences , Here's the picture :

Now delete the two unnecessary columns . Because we want to divide apples and oranges into 0 and 1, And in these three columns , All apples in the second column are 1, All oranges and samples to be predicted are 0, So delete the first and third columns here , And put the... Of the sample to be predicted 0 Delete . The effect after deletion is as follows :

Then perform the following operations :

When there are classified indicators in the indicators ( Such as gender ) when , Put this variable into the classification covariate :

Now we can get the result :

According to the table of logistic regression coefficients, the calculation formula of the model can be written :


When the model results are poor :

After adding the square term, the result is as follows :

You can see , At this time, the prediction accuracy is 100%, May have produced Over fitting ( The prediction effect on the training set is good , The effect of prediction set is poor ) Here's the picture :

The solution to over fitting :

1.2Fisher Linear discrimination
The previous operation is consistent with logistic regression , First, create virtual variables for classification indicators (01).
And then with the help of SPSS Realization Fisher Linear discriminant classification , among , The definition range is the category of classification indicators , In this case , There are two kinds , So it's 0-1, Here's the picture :

The classification results are as follows , The coefficient of the canonical discriminant function can be put into the paper , Here's the picture :

Two 、 Multiple classification problem
2.0 Case data

2.1 Logical regression

stay Excel Create virtual variables for classification indicators 1-4, After creation, see the following figure :

Then do the following :


The following results can be obtained :


2.2Fisher Linear discrimination
stay Excel Create virtual variables for classification indicators 1-4, After creation, see the following figure :

Fisher Linear discriminant realizes the multi classification problem, which is similar to the two classification , Just modify the scope of the definition ( The categories classified here are 4 class , So the scope is 1-4), Here are two pictures :


The result of the classification , In the classification result table , The above is the number of categories , The following is the probability of classification , Here's the picture :

The following figure shows the results , The first one in the box is the classification result , The second in the box is 4 The probability of two kinds , For example, in the first sample of prediction , It is predicted to be No 3 The probability of a class is 0.87121, Therefore, this sample is predicted as the third kind .

边栏推荐
- Tools in the tools package of Damon database (operate Damon database)
- Array - 704. Binary search
- 小说里的编程 【连载之十八】元宇宙里月亮弯弯
- [leetcode ladder] the penultimate node in the 022 linked list
- TikTok推出多语种字幕和翻译工具
- As a developer, you have to know the three performance testing tools JMeter, API and jmh user guide
- D2admin framework is basically used
- At the forefront of the times, Huawei aims at the wind and sea of digital finance
- Crazy bull market, where to go in the second half? 2021-04-30
- Mongodb - Introduction to the use of $exists and the combination of $ne, $nin, $nor, $not in query statements
猜你喜欢

Investment suggestions for overseas senior players (3) 2021-05-04

Excel password related

Mongodb - Introduction to the use of $exists and the combination of $ne, $nin, $nor, $not in query statements

Preparation for raspberry pie 3B serial port login

TAP 系列文章4 | 基于 Backstage 的 TAP 开发者门户

Build your own target detection environment, model configuration, data configuration mmdetection

糖尿病遗传风险检测挑战赛进阶

Three network modes of VMware virtual machine

Rails搭配OSS最佳实践

Diabetes genetic risk testing challenge advanced
随机推荐
1000 okaleido tiger launched binance NFT, triggering a rush to buy
【Matplotlib绘图】
【Unity3D日常BUG】Unity3D解决“找不到类型或命名空间名称“XXX”(您是否缺少using指令或程序集引用?)”等问题
Crazy bull market, where to go in the second half? 2021-04-30
How ZK solves the problem of cerebral fissure
Is it safe to open a VIP stock account on your mobile phone?
D1-H 开发板——哪吒 开发入门
Inspiration from Buffett's shareholders' meeting 2021-05-06
Merge.Avhd into.Vhd manually in Hyper-V
[leetcode ladder] linked list · 206 reverse linked list
SecureCRT garbled
Niuke C basic exercises
Use boundschecker "suggestions collection"
Programming in the novel [serial 18] the moon bends in the yuan universe
Getting started database days2
Array - 704. Binary search
USB转CAN设备在核酸提取仪 高性能USB接口CAN卡
Array -- 209. Subarray with the smallest length
[C language] address book (static version)
1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮