Looking for technical excellence is a mistake

If today someone ask me what is the best software I have designed, I would answer that the next. Every time I look back I feel embarrassed about the software I implemented and this is precisely…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Logistic Regression to Predict Extra Marital Affair

Affair dataset is present inside the stats models ,so we will be going to extract that library.

Output of first five rows
output of renamed X
Figure 1
Figure 2
Statistical description
Figure 3
Figure 5

As the married couple spend more and more years together there would be great chance that his wife would be in extra marital relation.Best result of trust and negligible extra marital affair seen in newly married couple.

Figure 6

From above figure we can say large bunch of women is satisfied with their married life irrespective of their affairs.

Women who is doing white collar jobs having less chance of affair and women with graduation and higher educational background also has less chance of affair but for those women who is in college and have lower literacy has shown more interest in extra marital affairs.

Figure 7

More the women will be religious lesser will be the chance that women will have extra marital affair.

splitting the data into train and test set

Making model and doing prediction

As we see there is not large deviation between dataset hence model is in normal state.

Accuracy matrix to check TP ,TN ,FP ,FN values.

Figure 8

Here we should be careful about FP because our model will predict the women having affair but in actual she won’t have any affair which may leads to divorce for the mistake she has not done so we should show some carefulness about FP value when we are dealing with such sensitive kind of prediction.

Finding Precision,Recall F1- Score

Figure 9

ROC CURVE

Figure 10

Prediction chance for the upper given test set is 27.7 percent and the predicted result would be;

Prediction result for given data is that the women doesn’t have affair.

Conclusion :

Hope this blog gave you better idea about how logistic regression works in classification problem . Keep Learning Keep Exploring ………

Add a comment

Related posts:

What is Intelligence?

The ability of a system to calculate, reason, perceive relationships and analogies, learn from experience, store and retrieve information from memory, solve problems, comprehend complex ideas, use…

Bibit Jambu Air Citra Karanganyar

bibit jambu air citra Siapa yang tidak kenal dengan jambu air? semua orang sepertinya sudah sangat familiar dengan buah yang satu ini. Buah yang terkenal karena memiliki kandungan air yang melimpah…

Avoid Email Hacking By Using Disposable Emails In 2022

Are you looking for a way to avoid email hacking by using disposable emails in 2022? Then, stop looking because in this article we will tell you how to do it! Email hacking is one of the top dangers…