Machine Learning Tutorial Python - 8: Logistic Regression (Binary Classification)

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 617

  • @codebasics
    @codebasics  2 роки тому +15

    Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced

  • @interesting_vdos
    @interesting_vdos 3 роки тому +41

    I have never seen any other video explaining the concepts of machine learning so clearly. Keep up the great work..!!

  • @sidduhedaginal
    @sidduhedaginal 4 роки тому +26

    Finally i got perfect trainer for ML, your skills are excellence sir, we are very proud of you sir.

    • @codebasics
      @codebasics  4 роки тому +3

      Glad you liked it :)

    • @matinpathan5186
      @matinpathan5186 4 роки тому +2

      Yes is good but if you like his tutorials then tell your friend to subscribe his channel and hit the like button... that we can do from our side

  • @ansh6848
    @ansh6848 3 роки тому +5

    Best course you can get for learning ML is this only.
    Explanation is super awesome.
    Actually most of the books and courses shows you complex looking mathematical equations but this guy made all that easy for us.

  • @MoreBalaji
    @MoreBalaji 3 роки тому +12

    Perfectly balanced video. It forces anyone to continue to watch other videos of this series. Very well explained in simple language. 👌

  • @bhawin101283
    @bhawin101283 6 років тому +100

    Perfect explanation with proper examples. Great job.

    • @anand.prasad502
      @anand.prasad502 4 роки тому +1

      medium.com/trainyourbrain/would-you-read-this-article-or-not-b757d0e26cf8

  • @Sarah-st7jp
    @Sarah-st7jp 3 роки тому +26

    Sir, I know so surely that I can bank on your data science and python videos when I need to gain an in-depth understanding. Your content gives me the hope and clarity that I needed. God bless you and your undying passion to make such useful content for us. Thank you so much for all your hard-work sir!!! :)

  • @zerostudy7508
    @zerostudy7508 6 років тому +4

    i'm Not afraid to learn things with complicated term anymore! this teacher is the best at explanation.

    • @zerostudy7508
      @zerostudy7508 6 років тому

      @@codebasics You are good at it. I thank you.

  • @pamp3657
    @pamp3657 2 роки тому +6

    One of the few videos that clearly shows the training data that the model is attempting to fit to. Thank you.

  • @PollyMwangi-cp3jn
    @PollyMwangi-cp3jn 10 місяців тому +3

    Actually, I fine tuned my model and was able to achieve an accuracy of 1.0. Thankyou so much sir. This might just be the best channel I have seen.🥳

    • @kibs_neville
      @kibs_neville 10 місяців тому +2

      Hi, I have some slight problem. How can I plot the prediction curve after training my model? Would be glad if you reply. Thanks

    • @anishagarwal71
      @anishagarwal71 7 місяців тому

      Could you pls tell me what exactly did you do to fine tune it?

    • @ayushchauhan301
      @ayushchauhan301 24 дні тому

      If your testing data is so small then you can achieve accuracy 1 very easily ​@@anishagarwal71

  • @riyamitra8901
    @riyamitra8901 2 роки тому +2

    For the first time after so many courses, videos, whitepapers, github, kaggle, exercises, wiki pages I am genuinely enjoying Machine Learning and I am doing all the coding and exercises by myself obviously after learning and understanding it all. Thanks a lot!!!

    • @codebasics
      @codebasics  2 роки тому +2

      Glad you like them Riya and I wish you all the best! I have many playlists and recently left my job to focus on online teaching. My goal is to produce even a better quality tutorials then this.

    • @riyamitra8901
      @riyamitra8901 2 роки тому

      @@codebasics I am trying to follow all of your videos to improve in my career. I am trying to get a job with a clear concept.

    • @riyamitra8901
      @riyamitra8901 2 роки тому +1

      @@codebasics One question here. Why we did not remove one of the dummy variable after dropping salary column in Logistic regression like we did for Linear?

    • @09_samarpanbasu7
      @09_samarpanbasu7 Рік тому

      @@riyamitra8901 I think ...as logistic regression can handle multicollinearity between the dummy variables so it's not necessary to drop the last col.

  • @ObianujuFlorenceOhawuchi
    @ObianujuFlorenceOhawuchi 7 місяців тому

    You make people feel so welcomed to data field with your teaching skills. You are always the best.

  • @businnovate
    @businnovate 6 місяців тому +13

    Why didn't you plot the sigmoid curve but only showed the scatter plot?

  • @manusingh9007
    @manusingh9007 4 роки тому +2

    On first attempt, i considered 'left' as dependent variable and everything else including salary and department as independent variable, got 77% score of accuracy. Thanks for the wonderful video.

    • @codebasics
      @codebasics  4 роки тому

      Great job manu. its a good score. Video description has a solution link, you can verify your code with mine.

  • @nguyentuanhung3858
    @nguyentuanhung3858 Рік тому

    Started learning machine learning on your youtube.
    Absolute Masterclass , you are my real teacher sir!!!

  • @shivangitomar5557
    @shivangitomar5557 4 роки тому +10

    You are the best teacher! I love the exercises at the end of each topic, which strengthens our understanding of what we learnt!!! Thank you so much! :)

    • @codebasics
      @codebasics  4 роки тому +1

      I am glad it was helpful. :)

  • @shreyasb.s3819
    @shreyasb.s3819 2 роки тому

    I never seen anyone explaining simple as like this.
    Others making complicated like maths intuition.
    Thanks code basics

  • @piyushjha8888
    @piyushjha8888 5 років тому +5

    78 percent accuracy. I do all your exercises but in this I learned a lot. Thank you sir for such a great series @codebasics

    • @kalaipradeep2753
      @kalaipradeep2753 Рік тому

      Hi bro....

    • @kalaipradeep2753
      @kalaipradeep2753 Рік тому

      Now I learn machine learning....
      Now What are you doing. I mean study or work

    • @piyushjha8888
      @piyushjha8888 Рік тому +1

      I work in a bank as a software engineer. This channel is a gem as this explains the ML concept in laymen terms. I was able to give most of the answers related to ML because of codebasics and deep learning Andrew Ng course

  • @sunnyveerpratapsingh1102
    @sunnyveerpratapsingh1102 5 років тому +3

    bro you are best .. tried to swirl thru other online videos and then I end up watching your videos and I understand better .

    • @codebasics
      @codebasics  5 років тому +1

      Sunnny Singh, I am happy this was helpful to you

    • @rutvikkumbhar6736
      @rutvikkumbhar6736 Рік тому

      Any update you can give how's your data science journey is going as I am aspiring to be a data scientist..

  • @flyingsalmon
    @flyingsalmon 2 роки тому +5

    I love your tutorials. They're perfectly paced, with right amount of context and explanation, great examples, and patient but efficient delivery. I hope you continue to produce more. Subscribed here and also Liked all of the videos I've found so far from you. Best.

  • @san9870
    @san9870 7 днів тому

    This is my week 18 of AI Roadmap so far everything is going perfect, and i just wanted to thank you for giving me right direction.

  • @zestful14
    @zestful14 4 роки тому +1

    This video is fantastic. I'm teaching myself machine learning and this was one of the most helpful resources I've found online. Excited to watch/work-through the rest of the videos! Thank you so much

    • @anand.prasad502
      @anand.prasad502 4 роки тому

      medium.com/trainyourbrain/would-you-read-this-article-or-not-b757d0e26cf8

  • @icyjump1684
    @icyjump1684 11 місяців тому +2

    I only could get 77 with logisitic, but then i used lazypredict to find a higher accuracy and then used desicion tree classifier to get a 98, ty!

  • @abhishekdobliyal7178
    @abhishekdobliyal7178 4 роки тому +6

    Thank You Sir, I have learned a lot from your vids :). I was really perplexed by Logistic Regression and I am glad
    UA-cam recommended this to me :)

  • @pratikghute2343
    @pratikghute2343 2 роки тому

    I have no other words to say, the comments done by others have already conveyed my message to you!, Lots of love and thank you !

  • @adityabikramarandhara9477
    @adityabikramarandhara9477 2 роки тому +4

    Thanks a lot for the lucid explanation.
    In the exercise, I got an accuracy of 77.2% in my model prediction.

    • @kalaipradeep2753
      @kalaipradeep2753 Рік тому

      Hi bro...
      Now I learn machine learning...
      What are you doing.... I mean study or work

  • @mehmetkaya4330
    @mehmetkaya4330 6 років тому +10

    Thank you again! Great explanation! Always great tutorials!

  • @GeorgeTrialonis
    @GeorgeTrialonis 5 років тому +6

    Thank you very much for the videos on ML, AI, Python, etc. They help me learn a lot. Your explanations are clear and well understood. Thanks.

  • @siddhantkaushik4606
    @siddhantkaushik4606 3 роки тому

    amazing.
    astounding.
    bewildering.
    breathtaking.
    extraordinary.
    impressive.
    marvelous.
    miraculous.
    even all these adjectives are less to tell the quality of the video.
    Thanks a million.

    • @codebasics
      @codebasics  3 роки тому

      ha ha .. nice. you made my day with this shower of praise Siddhant. Thank you for your kind words :)

  • @khalidhasan1793
    @khalidhasan1793 2 роки тому

    I paused the video and commented, it's an excellent series that begins with ML.

  • @guneyfatma
    @guneyfatma Рік тому +1

    Thnaks a lot for theese amazing contents. I have just discovered your videos!

  • @nilupulperera
    @nilupulperera 4 роки тому +1

    Dear Sir
    What a beautiful datasheet you have provided for practice with this video.
    Spent more than two days to play with it.
    Playing with the datasheet opened another dimension of the learning curve.
    Thank you very much for providing relevant exercises like this as a challenge!

    • @codebasics
      @codebasics  4 роки тому +1

      Happy that this is helping you Nilupul.

  • @mario1ua
    @mario1ua Рік тому +1

    Great explanation, I've understood everything, thanks!

  • @tariqahassan5692
    @tariqahassan5692 8 місяців тому

    it is one of the fantastic videos about Logistic Regression .. Many thanks

  • @michaelpeel3716
    @michaelpeel3716 2 роки тому +1

    Many thanks this is the first explanation that provides context and examples making its so simple to understand.

    • @codebasics
      @codebasics  2 роки тому

      Glad you liked it Michael

    • @engihabit
      @engihabit 2 роки тому

      @@codebasics 15:35 I can’t execute it??
      model.predict(57) and any number like 25, 60 got the following ValueError: Expected 2D array, got 1D array instead:
      array=[57].

  • @Malayalam_learner
    @Malayalam_learner 2 місяці тому

    Daily 2 videos of your ml playlist completes my day❤

  • @fahadreda3060
    @fahadreda3060 6 років тому +4

    Another Great Tutorial, Thank you sir, Waiting for the next tutorial, keep up the good work

  • @0xN1nja
    @0xN1nja 2 роки тому

    one of the best explanation I've ever seen

  • @mponcardas94
    @mponcardas94 5 років тому +7

    I love your series of videos as you are concerned with the student's learning! Thanks!

  • @boughrood
    @boughrood Рік тому

    Very interesting and useful - well presented too

  • @bestineouya5716
    @bestineouya5716 4 роки тому

    Actually you are the best explainer

  • @codinghighlightswithsadra7343

    Thanks a bunch, Subscribed here and also Liked all of the videos I've found so far from you. Best.

  • @leooel4650
    @leooel4650 6 років тому +8

    Awesome as always, thanks for everything!
    i got a 77% model accuracy based on the satisfaction_level

    • @jsbean8415
      @jsbean8415 4 роки тому

      How did you get the prediction model accuracy by depedent variable? And 77% meaning is the probability that they will leave the company?

    • @nxbil2397
      @nxbil2397 4 роки тому

      @@jsbean8415 model.score()

    • @jsbean8415
      @jsbean8415 4 роки тому

      @@nxbil2397 that will show you the overal accuracy of your model. My question is , how you will get the probablity % that the employee will leave given the dependent variables? Like the one you have mentioned "satisfaction level".

  • @guneyfatma
    @guneyfatma Рік тому +1

    Why do we write x and y arguments in split method? Is it because of syntax?

  • @shuaibalghazali3405
    @shuaibalghazali3405 Рік тому

    Thanks a lot for this i was able to implement logistic regression after so many tutorials

  • @jugabrat6797
    @jugabrat6797 Рік тому

    Your way of teaching is very good. Thanks for the video ❤❤❤

  • @SohelRana-eq4ib
    @SohelRana-eq4ib 3 роки тому

    You are the best teacher

  • @asamadawais
    @asamadawais 3 роки тому

    Dhavel you are excellent in explaining difficult concepts in very simple language!

    • @codebasics
      @codebasics  3 роки тому +1

      I am happy this was helpful to you.

  • @mageshs5726
    @mageshs5726 4 роки тому +1

    I got 78.833 accuracy value. In this exercise i had known lot of things thank you bro.

    • @pranavnigam11
      @pranavnigam11 4 роки тому +1

      I also got around ~78.5% using the average monthly hours and satisfaction level. Did you use the same features??

    • @codebasics
      @codebasics  4 роки тому +1

      That’s the way to go Magesh, good job working on that exercise

  • @mapa5000
    @mapa5000 Рік тому

    Thank you very much ! Your videos are always my best choice to learn ML

  • @MultiSpiros123
    @MultiSpiros123 5 років тому +2

    Thanks one of the best tutorials !

  • @sundayagu2078
    @sundayagu2078 3 роки тому

    God bless you and may He provide angles to solve all your problems. Thank you

  • @SandeepYadav-pm8yc
    @SandeepYadav-pm8yc 5 років тому +3

    Finally got the Python version of Andrew Ag's machine learning course. With a better explanation.
    thanks.

  • @study_with_thor
    @study_with_thor 3 роки тому +1

    Perfect explanation!

  • @noorameera26
    @noorameera26 4 роки тому +1

    This video is really really good. Love the way you teach, your pacing and all the things you mentioned are really useful. Thank u and may god bless u!

  • @shreyaasthana7313
    @shreyaasthana7313 Рік тому

    Sir I tried this method, it is very easy to understand and use.. thank you sir

  • @VyNguyen-xy3il
    @VyNguyen-xy3il Рік тому

    Sir, I extremely appreciate your videos and efforts in teaching these things. Very helpful and great explanation!!

  • @DataThinkers
    @DataThinkers 6 років тому +2

    Nice Sir, try to create SVM or PCA next with some mathematical explanation. thank you

  • @pagnonig
    @pagnonig 4 роки тому +1

    Your videos are awesome. I'm learning so much!

  • @Sparshchokra
    @Sparshchokra 6 років тому

    Hi, i found your course is truly enhancing the path towards Machine Learning concepts, kindly continue this and sir achieve a complete set of this machine learning course including all the kick start algorithms.
    Thanks
    Sparsh

    • @codebasics
      @codebasics  6 років тому +1

      Thanks for appreciation Sparsh. I am continuing the series, it is just that due to my schedule I am not finding lot of time to work on it but I will try my best to speed up new tutorial additions.

  • @abdulmuzakir
    @abdulmuzakir 4 роки тому +1

    Thanks, sir .. your explanation is really clear and so easy to understand 👍🏼

  • @pallabsaha4098
    @pallabsaha4098 6 років тому +6

    thank you sir for your video.

  • @vinitasharma5025
    @vinitasharma5025 2 роки тому

    very useful video.... you explain everything in a very simple manner. Thank you

  • @balasubramanian5232
    @balasubramanian5232 4 роки тому +3

    Sir Kindly confirm whether you already have a video for how to do Exploratory data analysis and feature selection. Thank you.

  • @mojojojo1854
    @mojojojo1854 6 років тому +18

    sir please start Deep learning tutorials :)

    • @codebasics
      @codebasics  4 роки тому +6

      I am going to start that in next few days. Stay tuned :)

    • @svenko333
      @svenko333 3 роки тому

      @@codebasics You are a life saver! Just keep up a great content and if I ever see you, I need to buy you a drink or something for all of this, thank you a lot

  • @phaniauce
    @phaniauce 4 роки тому

    Awesome explanation. I like this practical math and algorithmic explanation.

  • @chrismagee5845
    @chrismagee5845 2 роки тому

    Exactly what I was looking for, Thank You!

  • @suleimanachimugu9048
    @suleimanachimugu9048 2 роки тому

    0.84 accuracy score and 0.83 mean cross validation score.
    Thanks, Your tutorials have been helpful.

  • @aashishshrestha8180
    @aashishshrestha8180 3 роки тому

    Very Clear Explanation

  • @barakatosalon
    @barakatosalon 6 років тому +1

    Great Class, you are the best of the best !!!

  • @micro_Dots
    @micro_Dots 3 роки тому

    clearly understandable explanation.
    Thank you so much.

  • @namitakala393
    @namitakala393 6 місяців тому

    thankyou for making videos, your content is great

  • @Christian-mn8dh
    @Christian-mn8dh 5 років тому +4

    just subscribed, your very good at explaining. thank you!

    • @codebasics
      @codebasics  5 років тому

      I am glad you liked it Pablo

  • @prakritreeeeeee
    @prakritreeeeeee 2 роки тому

    Thank you so much for the graphical explanation...the concepts are crystal clear in my mind now.

  • @nsbeastgaming
    @nsbeastgaming 4 роки тому

    nice explanation ever sir .

  • @ridael-mehdawe4681
    @ridael-mehdawe4681 5 років тому

    among several videos, this one is the best. appreciated

  • @ganeshgopalakrishnan6193
    @ganeshgopalakrishnan6193 5 років тому

    Very good explanation

  • @laxpanwar11
    @laxpanwar11 6 місяців тому

    Thanks. It is really informative.

  • @userhandle-u7b
    @userhandle-u7b 7 місяців тому

    Thank you so much, sir. I've got the score in the exercise 0.797. 🙂

  • @paramjeetgill1558
    @paramjeetgill1558 5 років тому

    Very nice and you present easiest way to understand. Thank you

  • @devanshgoel9070
    @devanshgoel9070 3 роки тому

    Thank you sir for this amazing explanation of Logistic Regression.

  • @Hari983
    @Hari983 3 роки тому

    Very well done and explained even for beginners - thank you so much!

  • @amanullahmahabub78
    @amanullahmahabub78 5 років тому

    You guys are life savers. man love your videos.

    • @codebasics
      @codebasics  5 років тому

      Amanullah, I am happy it helped you :)

  • @bandhammanikanta1664
    @bandhammanikanta1664 5 років тому

    Perfect explanation on logistic regression.
    Loved it. Thanks a lot.

    • @anand.prasad502
      @anand.prasad502 4 роки тому

      medium.com/trainyourbrain/would-you-read-this-article-or-not-b757d0e26cf8

  • @aditinagar6688
    @aditinagar6688 4 роки тому +2

    Sir, why didn't you drop one of the salary column after categorizing it using dummy variable in the solution ?

    • @aravind_k28
      @aravind_k28 4 роки тому +2

      Yes, why didn't you drop one column after one-hot encoding? If you didn't drop it, then you will encounter a dummy variable trap, isn't it?

    • @Fengin221
      @Fengin221 4 роки тому +1

      Yea, same question. I think we should drop one of the low,med,high salary columns

    • @vishaldas6346
      @vishaldas6346 4 роки тому

      @@Fengin221 Why to make data complex, there are only 2 columns in the dataset. And there aren't any Nan values.

    • @Fengin221
      @Fengin221 4 роки тому

      @@vishaldas6346 we should drop a column to avoid multicoliniarity.
      e.g the Low and med cols can predict what is on high column.

    • @karanrana5814
      @karanrana5814 4 роки тому

      It is actually not necessary it is intelligent enough to not to fall into the dummy variable trap.

  • @PlayingCode
    @PlayingCode 3 роки тому +2

    Hey plz tell me what to do when I have multiple Columns like age ,weight , bmi that i need to consider for prediction

  • @imaansarwar2314
    @imaansarwar2314 2 роки тому

    thank you so much ! you have helped alot in learning the algorithms. Saved time with such a quick and easy way of explaining as I didn't have time for my fyp compleion and these videos are saving my time to get an idea of all algorihtms

  • @danielnderitu5886
    @danielnderitu5886 3 роки тому

    I like your tutorials very much, the explanation therein is superb and makes one understand even very hard to grasp concepts.

  • @saranyachimirala8351
    @saranyachimirala8351 4 роки тому +2

    This video had good information, it was really helpful. I am still a learner, new to this field. I understand how to write and basics of confusion matrix using binary classification. But some terminologies are confusing. Can you please explain what exactly are base rate, test incidence, conditional incidence, classification incidence? That would be appreciated.

  • @tayfundogruer8026
    @tayfundogruer8026 Рік тому

    Bro it was easy and clean. Thanks!

  • @lightonkalumba
    @lightonkalumba Рік тому

    lol i just love the part on the exercise when he sayed you are a data scientist.

  • @gusinthecloud
    @gusinthecloud 3 роки тому

    The best explanation as always

  • @PolkadOfficial
    @PolkadOfficial Рік тому

    Very well explained, thanks!

  • @kibs_neville
    @kibs_neville 10 місяців тому

    Well explained, Thanks!

  • @yashpal3027
    @yashpal3027 4 роки тому

    Amazing lectures.

  • @shashikantpandit663
    @shashikantpandit663 4 роки тому

    awesome explanation....really

  • @pranav9339
    @pranav9339 Рік тому +2

    If you could build a machine learning model for HR department, then you can remove HR department 😂😂

  • @shylashreedev2685
    @shylashreedev2685 2 роки тому

    Thank u so much..it really helped to clear my concepts

  • @ravisrivastava2909
    @ravisrivastava2909 4 роки тому +3

    Hello Sir! Great work by you.
    there is a problem in your code may be due to version of python ....
    If we use X_train, X_test, y_train, y_test = train_test_split(df[['age']],df[['bought_insurance']],train_size=0.9)
    then only we get score of 1
    otherwise with your code it is 0.66.

    • @Myanmartaeyang
      @Myanmartaeyang 4 роки тому

      OMG. I was trying to run the code and did not know why mine was 66%. Thank you for this !!!

  • @linusolmin9313
    @linusolmin9313 7 місяців тому

    Thank you! So well done