MLops : Session - 15

MLops : Session - 15

No alt text provided for this image

In the last article, I explain how we do feature selection and feature elimination using Visuals(Graphs). We also see some data cleaning part which is almost 70-80% work of a data scientist. Here I mention one more thing that for better doing feature selection task, you must know a little bit of that domain.

Today I start model training and prediction part and also know how to check accuracy in binary classification.

Binary Classification:

Let me start where I left in the last session.

No alt text provided for this image

After doing the data cleaning part, we get this clean dataset which is ready for training. But we also have some categorical variables in our dataset, so we also do ONEHOT encoding on our categorical variable. I discuss this in this article.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Now I got my independent and dependent variable. Now come to the next step.

Training and Prediction part:

We use Logistic Regression to create and train our model.

No alt text provided for this image


Now our model is ready for prediction.

Now come to the most important part.

Check the accuracy of the model:

For checking the accuracy of our model, we use Confusion_matrix.

No alt text provided for this image
No alt text provided for this image

By the above figure, you easily understand what happens. We use this matrix to get the model accuracy.

record = 140+17+33+78
trueanswer = 140 + 78
accurcy = trueanswer / record * 100
error = 33 + 17
error% = error / record *100

Finally, you get that your model is 80% accurate.😊

In our next article, we see some more things...

Hope you learn something. I suggest do one hands-on practice too for better understanding,

Happy Learning :)

To view or add a comment, sign in

More articles by Gaurav Gupta

Others also viewed

Explore content categories