49 - Logistic Regression using scikit-learn in Python
HTML-код
- Опубликовано: 7 окт 2024
- This tutorial explains the few lines to code logistic regression in Python using scikit-learn library.
The code from this video is available at: github.com/bns...
I usually do not comment on videos but had to for this one. Wonderfully explained with step-by-step instructions. Thank you!
Glad it was helpful!
Sreeni......exceptional work man! The quality of your content and simplicity in explaining key concepts is very impressive. Keep up the awesome work!
Thanks for the encouraging comment :)
@@DigitalSreeni Sir please share this dataset
Great work best video for machine learning algorithm I've ever seen
Thank YOU for your time and patience for the videos!
My pleasure!
Love this video. This is the most explicit and practical tutorial on logistic regression in Python I've ever seen.
Great to hear!
@@DigitalSreeni Sir please share the dataset(csv)
if the Visualization is also shown within this tutorial then it would be a wonderful explanation as you do always. Thank you for sharing
Great tutorial, thank you, Sreeni!
Nice step by step explanation :)
Thank you sir, this is pretty good. an exceptional work indeed
great content..keep it uploading!!
I appreciate you ... the tutorials are really helpful
Glad you like them!
Sir, You explained these concepts in a best possible way! Thanks for helping us a lot .
Any suggestions for Beginners?
Thank you so much...fantastic
Great job man. i know about logistic regretion but not using model selection and train test imports.. Good to learn a quick way to make it
Some improvements on this code, find a way to show the sigmoid and the cost x iteraction graph.
edit: This code uses 100 iteractions as max number, wheres only 27 were needed. The Learning ratio or alpha, well i was looking for it, until realize that this is a Stochastic Average Gradient. Wich we can obtain the number, but we can't modify it..
For those who are interested about it:
datascience.stackexchange.com/questions/16751/learning-rate-in-logistic-regression-with-sklearn
As it says, this one defines the method hal.inria.fr/hal-00860051/document
and this one defines the implementation of the solver:
github.com/scikit-learn/scikit-learn/blob/a24c8b464d094d2c468a16ea9f8bf8d42d949f84/sklearn/linear_model/sag.py
The learning rate, or alpha is a fixed value = 1
Thank you so much 🙏
You're welcome 😊
I think you can improve the prediction keeping user feature un the model using one hot encoding,
Thank for the video.
What should we do if the dataset is divided %90 is 0 %10 percent is 1?
Thanks for your nice work. May you show me what difference between random_state =20 or 1 or other numbers that are not None? Thanks
It doesn't make any difference when you use 20 or 1 or something else for random state. It is there to split data the same way every time you split. If you keep random state to 20 then it the split would be the same. If you have random state as None then every time you split it would be different, which makes any troubleshooting challenging.
The result of Logistic Regression function is a real number within [0,1]. Thus, you can set df.Productivity within [0,1].
However, you set df.Productivty=2 in Line 25. It must be 0. Do I miss something?
The 1 and 2 for productivity are the labels for Good and Bad, respectively. The labels can be anything, it has nothing to do with the range for logistic regression. The range for logistic regression goes from 0 (low probability) to 1 (high probability). Based on the probability the system sets a threshold to convert probability to classification. In summary, if the probability for a data point to belong to class labeled as 2 is high (e.g. 0.8) then that data point is assigned to class 2.
@@DigitalSreeni Ok. I understand that LogisticRegression results are internally converted to our integer labels within skilearn functions automatically.
what if the output is not only "bad" or "good" but what if there's "normal" too? It isn't binary anymore. How can i deal with it please?
Can we do this method for multiple class classification problems? instead of 2
Yes. Here is an example: scikit-learn.org/stable/auto_examples/linear_model/plot_iris_logistic.html
Hey, I am working on Google Colaboratory.
And this line of code Y = Y.astype('int') is not working.
kindly help.
where can I get this dataset
same problem
😋😪
Nice tutorial. However, instead you telling us go the previous tutorial, why not leave the link here, so it would be easy to find it. Or better still leave a link to the play list
When I usually refer to previous video mean the previous video in my numbering scheme. For example, the previous video to this video would be video 48. It would be a lot of effort for me to directly post links in description but I understand your pain. It is always a choice between recording new videos or go back and add more info to description. One of these days I hope to find time time to add more description.