How I Came to Love What I Thought was the Worst Diet in the World

For most of my adult life, I took pride in following what I thought was the healthiest diet in the world: the Mediterranean Diet. I also ate lots of fiber. That all changed recently after another…

Smartphone

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




Logistic Regression Model in 9 Steps with Python

In this ML model series, Logistic Regression is the first classification model. Logistic regression is used to classify the two-classes dataset. In our practice, we have a dataset about the people watching a social network advertisement. The dataset includes the people’s userId, gender, age, estimated salary and whether these people purchased SUV type car. We try to build a model that classifies the points into the people purchasing or not purchasing the SUV. The independent variables are age and estimated salary and the dependent variable is a boolean variable of 0 or 1.

Data Preprocessing:

cm=[[65, 3], [ 8, 24]] means totally 89 correct and 11 incorrect prediction in this model
Red and Blue points reveal the observation points of our Training Dataset

Red points are the ones not purchasing the SUV and the blue points are the ones purchasing the SUV. The goal of this model is to classify the right users into the right categories. Prediction regions are the two sides of the graph and the red region represents 0 and the blue region represents 1. The division line between these regions called the prediction boundary. This line is a straight line because our model defined a linear classifier. The dataset in the upper case is the training set thus the model learned how to classify based on this information.

Red and Blue points reveal the real points of our Test Dataset

We could observe the correct and incorrect predictions in the confusion matrix.

References:

Add a comment

Related posts:

The British in Bengal Part III

The Indian Rebellion of 1857 ended the Mughal Empire and the British East India Company. It also heralded the beginning of the British Raj.

A race to run

We have this race for a 100 dollars and we have rules before they run this race I saw this on YouTube and it made me open my eyes to how privileged some people really are. So there rules that you…

Why you need to GIT good

Git is a version control system by which a single person or a large group of contributors can work on a project simultaneously while maintaining organization and tracking throughout version changes…