Logistic Regression in Python - Machine Learning Basics

preview_player
Показать описание
This video explains the step by step process of implementing the logistic regression algorithm from scratch using python, for beginners. At the end I also compare it with an existing model using sklearn. First off we define logistic regression and what the logistic model exactly is. Then we define a loss function and use the gradient descent algorithm to estimate the weights. Finally we implement the algorithm from scratch using python and and also implement it using sklearn and compare the results.

The Google Colab with Explanation & Code:

Written version in Medium:

To learn more about Logistic Regression check out my references:
Artificial Intelligence, a modern approach - pg 726, 727

Having trouble ? Need help ? Connect with me !

#machinelearning #datascience #regression #gradientdescent
Рекомендации по теме
Комментарии
Автор

Hey man, you just saved me from my assignment deadline and by explaining the doubts step by step.

raghunathanp
Автор

It's very hard to find simple explanations on Youtube.. but I finally found one.. thanks again!

nano
Автор

Great Video man! Best Logistical Regression video on Youtube

albertojim
Автор

This is such a well-thought-out video. Easy to follow, comprehensive, and actionable! Thank you so much

anekamulgund
Автор

Classy one ... true numerical method approach

vijanth
Автор

Hi Adarsh. Can you explain the mathematics behind SVM and implement from scratch in python?

Saimelodies
Автор

Hi Adarsh. Thanks for the detailed explanation. It does appear that in your explanation y_i were given as probabilities. But we know that in these problems, we usually have the classes of the datapoints and not their probabilities. Could you help me understand how the ACTUAL probabilities are derived from the classes, if they are?

stanleynwanekezie
Автор

adarsh, should it not be x1? why xi? as you are saying single feature at 4:38? kindly clarify. i goes from 0 to n means we have n number of samples and we have a single feature and two biases b0, b1. kindly correct me if i am wrong..

Saimelodies
Автор

Hello. I am not familiar with math terms because I am very young like... in school right now... Can you explain why we are shifting mean to the origin? I want to understand these concepts because sklearn is very very easy and understanding these concepts is much more important than to do something like model.fit(x_train, y_train) and wait for the magic to happen...
Btw, I read your blog on Logistic Regression and your videos are really helpful and very simple to understand. Thank you for reading.

neillunavat
Автор

how do you do this with multiple predictor variables, in this example there is just one variable in the X data frame

kunalroy
Автор

What will be the algo if we are using more than one feature column? You didn't explain generalized algorithm.

karmabender
Автор

Sir plzz help me how can I do this if there are 2 indep variables.. I am not able to return the array in that case please help me sirrr please

turtlepedia
Автор

you didnt normalize dataset for sklearn regression, did you?

FedorT
Автор

I still don't understand what is the purpose of the normalizing function

khushijain
Автор

So Adarsh bro this whole code will only work when we have only two classification... bro u need to understand that not everybody has so simple datset like yours with two classes ... that would have been a great video if you would have explained when we have more than two classification otherwise its not really good.... if u can only do this with two classification then u didn't grow????
U haven't experimented ??
U haven't tried doing it with different dataset having more than two classification ?

Gygle-lbkq