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

Поделиться
HTML-код
  • Опубликовано: 23 июл 2024
  • Logistic regression is used for classification problems in machine learning. This tutorial will show you how to use sklearn logisticregression class to solve binary classification problem to predict if a customer would buy a life insurance. At the end we have an interesting exercise for you to solve.
    Usually there are two types of machine learning problems (1) Linear regression where prediction value is continuous (2) Classification where predicted value is categorical. Logistic regression is used for classification problems mainly.
    #MachineLearning #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #LogisticRegression #sklearntutorials #scikitlearntutorials
    Code: github.com/codebasics/py/blob...
    Exercise: Open above notebook from github and go to the end.
    Exercise solution: github.com/codebasics/py/blob...
    Topics that are covered in this Video:
    0:00 - Theory (Explain difference between logic regression and classification)
    1:18 - What is logistic regression?
    1:26 - Classification types (Binary vs multiclass classification)
    1:53 - Explanation of logistic regression using the example of if person will buy insurance based on his age
    5:38 - Sigmoid or Logit function
    8:18 - Coding (for coding we are using an example of if a person will buy insurance or not based on his age)
    14:36 - sklearn predict_proba() function
    15:49 - Exercise (Solve a problem of predicting employee retention based on salary, distance to work, promotion, department etc)
    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.
    Next Video:
    Machine Learning Tutorial Python - 8 Logistic Regression (Multiclass Classification): • Machine Learning Tutor...
    Populor Playlist:
    Data Science Full Course: • Data Science Full Cour...
    Data Science Project: • Machine Learning & Dat...
    Machine learning tutorials: • Machine Learning Tutor...
    Pandas: • Python Pandas Tutorial...
    matplotlib: • Matplotlib Tutorial 1 ...
    Python: • Why Should You Learn P...
    Jupyter Notebook: • What is Jupyter Notebo...
    Tools and Libraries:
    Scikit learn tutorials
    Sklearn tutorials
    Machine learning with scikit learn tutorials
    Machine learning with sklearn tutorials
    To download csv and code for all tutorials: go to github.com/codebasics/py, click on a green button to clone or download the entire repository and then go to relevant folder to get access to that specific file.
    🌎 My Website For Video Courses: codebasics.io/?...
    Need help building software or data analytics and AI solutions? My company www.atliq.com/ can help. Click on the Contact button on that website.
    #️⃣ Social Media #️⃣
    🔗 Discord: / discord
    📸 Dhaval's Personal Instagram: / dhavalsays
    📸 Codebasics Instagram: / codebasicshub
    🔊 Facebook: / codebasicshub
    📱 Twitter: / codebasicshub
    📝 Linkedin (Personal): / dhavalsays
    📝 Linkedin (Codebasics): / codebasics
    🔗 Patreon: www.patreon.com/codebasics?fa...

Комментарии • 607

  • @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

  • @codebasics
    @codebasics  4 года назад +12

    Step by step roadmap to learn data science in 6 months: ruclips.net/video/H4YcqULY1-Q/видео.html
    How to learn coding for beginners | Learn coding for free: ruclips.net/video/CptrlyD0LJ8/видео.html
    5 FREE data science projects for your resume with code: ruclips.net/video/957fQCm5aDo/видео.html

    • @hanselsamuel
      @hanselsamuel 3 года назад +2

      I really appreciate your tutorial videos, thank you. But how to find the "bought_insurance" values ?

  • @interesting_vdos
    @interesting_vdos 2 года назад +35

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

  • @pamp3657
    @pamp3657 Год назад +4

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

  • @ansh6848
    @ansh6848 2 года назад +4

    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 2 года назад +12

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

  • @bhawin101283
    @bhawin101283 5 лет назад +99

    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 2 года назад +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!!! :)

  • @codebasics
    @codebasics  4 года назад +1

    Solution link for the exercise: github.com/codebasics/py/blob/master/ML/7_logistic_reg/Exercise/7_logistic_regression_exercise.ipynb
    Step by step guide on how to learn data science for free: ruclips.net/video/Vn_mmOuQkSA/видео.html
    Machine learning tutorials with exercises:
    ruclips.net/video/gmvvaobm7eQ/видео.html

  • @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. :)

  • @mehmetkaya4330
    @mehmetkaya4330 5 лет назад +10

    Thank you again! Great explanation! Always great tutorials!

  • @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
    RUclips recommended this to me :)

  • @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

  • @sidduhedaginal
    @sidduhedaginal 4 года назад +17

    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 3 года назад +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

  • @shreyasb.s3819
    @shreyasb.s3819 Год назад

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

  • @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.

  • @fahadreda3060
    @fahadreda3060 5 лет назад +4

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

  • @zerostudy7508
    @zerostudy7508 5 лет назад +3

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

    • @zerostudy7508
      @zerostudy7508 5 лет назад

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

  • @GeorgeTrialonis
    @GeorgeTrialonis 4 года назад +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.

  • @mponcardas94
    @mponcardas94 5 лет назад +7

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

  • @nguyentuanhung3858
    @nguyentuanhung3858 7 месяцев назад

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

  • @user-ee6nk8sc3t
    @user-ee6nk8sc3t Месяц назад

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

  • @Hari983
    @Hari983 2 года назад

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

  • @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

  • @khalidhasan1793
    @khalidhasan1793 Год назад

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

  • @saranyachimirala8351
    @saranyachimirala8351 3 года назад +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.

  • @pagnonig
    @pagnonig 4 года назад +1

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

  • @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 года назад +1

      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.

  • @prakritreeeeeee
    @prakritreeeeeee 2 года назад

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

  • @ihasbaoui
    @ihasbaoui 3 года назад

    Thank you, now if you have many features in your binary classification problem, and the classes overlap from visualizing data using pca, is it advisable to use Logistic Regression in this case?

  • @pratikghute2343
    @pratikghute2343 Год назад

    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 !

  • @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.

  • @PollyMwangi-cp3jn
    @PollyMwangi-cp3jn 4 месяца назад +2

    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 4 месяца назад +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 Месяц назад

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

  • @shubhamjain6277
    @shubhamjain6277 4 года назад +1

    sir I have got an error "too many values to unpack" at 11:24,please help me to resolve this issue.

  • @barakatosalon
    @barakatosalon 5 лет назад +1

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

  • @adishvakharia3559
    @adishvakharia3559 4 года назад

    Detailed and really helpful. Thank you.

  • @sunnyveerpratapsingh1102
    @sunnyveerpratapsingh1102 4 года назад +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  4 года назад +1

      Sunnny Singh, I am happy this was helpful to you

    • @rutvikkumbhar6736
      @rutvikkumbhar6736 11 месяцев назад

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

  • @krishkonnect814
    @krishkonnect814 4 года назад +1

    one question though in the exercise given of employee retention why did not you dummify the dept variable and included in the features, cannot it be one of the important features which we should be including coz I have included it and got better score as well.

  • @piyushjha8888
    @piyushjha8888 4 года назад +4

    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 10 месяцев назад

      Hi bro....

    • @kalaipradeep2753
      @kalaipradeep2753 10 месяцев назад

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

    • @piyushjha8888
      @piyushjha8888 10 месяцев назад +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

  • @Sparshchokra
    @Sparshchokra 5 лет назад

    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  5 лет назад +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.

  • @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.

  • @VyNguyen-xy3il
    @VyNguyen-xy3il Год назад

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

  • @chrismagee5845
    @chrismagee5845 Год назад

    Exactly what I was looking for, Thank You!

  • @bandhammanikanta1664
    @bandhammanikanta1664 4 года назад

    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

  • @abdulmuzakir
    @abdulmuzakir 3 года назад +1

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

  • @guneyfatma
    @guneyfatma 9 месяцев назад +1

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

  • @phaniauce
    @phaniauce 4 года назад

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

  • @noorameera26
    @noorameera26 3 года назад +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!

  • @JainmiahSk
    @JainmiahSk 5 лет назад +2

    Building model means statistic formula will be the same but we use different columns of Data Frame for an output. Is it right sir?

  • @mapa5000
    @mapa5000 Год назад

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

  • @codinghighlightswithsadra7343
    @codinghighlightswithsadra7343 Год назад

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

  • @ridael-mehdawe4681
    @ridael-mehdawe4681 4 года назад

    among several videos, this one is the best. appreciated

  • @fahimshahriar3793
    @fahimshahriar3793 4 года назад

    sir, in your given exercise can we drop the independent variable by backward elimination process ??

  • @zaidzeee
    @zaidzeee 4 года назад

    this video really really very helpful.
    thank you so much for this amazing kwnldge
    please make more video request.

  • @manusingh9007
    @manusingh9007 4 года назад +1

    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.

  • @ayushpant6190
    @ayushpant6190 3 года назад +5

    I have a question, how is the slope value updated for logistic regression when finding the best fit plane or line to seperate the 2 classes?
    At first I thought gradient descent but that doesn't work because it is used to find the global minima

    • @ojassaxena2891
      @ojassaxena2891 2 года назад

      Maaeri aapahi hans di
      Maaeri aapahi rondi
      Maaeri yaad yaad wo aaeri

  • @danielnderitu5886
    @danielnderitu5886 2 года назад

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

  • @swaruppanda2842
    @swaruppanda2842 5 лет назад +1

    Suppose our target variable is in the form of categorical such as Yes & No. Then do we need to convert it as 1 & 0? Also, can we have a mixture of independent variable as categorical(string) and continous(numerical)?

  • @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

  • @mkoc9253
    @mkoc9253 5 лет назад +1

    Keşke türkçe altyazı da ekleseydiniz çok mutlu olurduk.Yine de elinize sağlık.

  • @linujose2536
    @linujose2536 5 лет назад +2

    amazing tutorial!

  • @DataThinkers
    @DataThinkers 5 лет назад +2

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

  • @MultiSpiros123
    @MultiSpiros123 5 лет назад +2

    Thanks one of the best tutorials !

  • @shivatarun9125
    @shivatarun9125 5 лет назад +2

    awesome.... :) Sir, could you please make a video on how to detect and handle/dealing with outliers in model..? eagerly awaiting from you, haven't got any clarity on outliers.

  • @paramjeetgill1558
    @paramjeetgill1558 5 лет назад

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

  • @pallabsaha4098
    @pallabsaha4098 5 лет назад +6

    thank you sir for your video.

  • @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 10 месяцев назад

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

  • @0xN1nja
    @0xN1nja 2 года назад

    one of the best explanation I've ever seen

  • @sundayagu2078
    @sundayagu2078 3 года назад

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

  • @shuaibalghazali3405
    @shuaibalghazali3405 8 месяцев назад

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

  • @hihi7896
    @hihi7896 2 года назад

    Hi, thank you for the super helpful video, I wanna ask why in the solution, you didn't drop 1 dummy variable (i.e drop medium and leave high and low) ?

  • @tayfundogruer8026
    @tayfundogruer8026 10 месяцев назад

    Bro it was easy and clean. Thanks!

  • @micro_Dots
    @micro_Dots 2 года назад

    clearly understandable explanation.
    Thank you so much.

  • @boughrood
    @boughrood 10 месяцев назад

    Very interesting and useful - well presented too

  • @krishkonnect814
    @krishkonnect814 4 года назад +1

    Thankyou very much for all help and support. Can you please make a video on mathematical explanation of sigmoid and logit function also ?

  • @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 :)

  • @roshangeorge97
    @roshangeorge97 Год назад

    thank you for the content, helped me a lot!

  • @nehasaroha2505
    @nehasaroha2505 5 лет назад +1

    A very nicely explained tutorial, thanks for sharing this. Can you please do a video on model validation techniques or guide me to some simple and intuitive online resource for the same.

  • @akhtarshaikh5594
    @akhtarshaikh5594 5 лет назад +1

    excellent explanation...thanks lot.. please make video on deep learning model using tensorflow and caffe...

  • @HearterSG
    @HearterSG 5 лет назад +1

    great again! looking forward to your future videos!

  • @hemanthpeddi4129
    @hemanthpeddi4129 4 года назад

    what is penalty=l2 in the output 5 at 13:56 ? Can you please explain the parameters of the function

  • @kibs_neville
    @kibs_neville 4 месяца назад

    Well explained, Thanks!

  • @amanullahmahabub78
    @amanullahmahabub78 4 года назад

    You guys are life savers. man love your videos.

    • @codebasics
      @codebasics  4 года назад

      Amanullah, I am happy it helped you :)

  • @tariqahassan5692
    @tariqahassan5692 2 месяца назад

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

  • @vaishnavi4354
    @vaishnavi4354 4 года назад +1

    Hello Sir
    actually I have one doubt
    Suppose We have multiple columns in our dataset and from that we have to plot the graph using all values.
    So shall we give all the column names as a parameter in the scatter()method
    Please reply me

  • @leooel4650
    @leooel4650 5 лет назад +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".

  • @linusolmin9313
    @linusolmin9313 Месяц назад

    Thank you! So well done

  • @namitakala393
    @namitakala393 10 дней назад

    thankyou for making videos, your content is great

  • @jugabrat6797
    @jugabrat6797 9 месяцев назад

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

  • @mario1ua
    @mario1ua 8 месяцев назад +1

    Great explanation, I've understood everything, thanks!

    • @codebasics
      @codebasics  8 месяцев назад +1

      Glad you found it helpful!

  • @prakharsahu9498
    @prakharsahu9498 5 лет назад +1

    Sir,how can we improve accuracy of model the model that I built for employee retention dataset is coming as 77%

    • @nxbil2397
      @nxbil2397 4 года назад

      Feed the model more dataset and train it will improve accuracy

  • @dilipkumar2k6
    @dilipkumar2k6 2 года назад

    Great explanation. Can you please share the slides you have used? Going through slides make it faster to revise the concepts.

  • @amandaahringer7466
    @amandaahringer7466 2 года назад

    Very helpful!

  • @ArunSharma-is2we
    @ArunSharma-is2we 4 года назад

    is this possible to have 0 and 1 both for the same age and we can compute them further based on probability?

  • @PlayingCode
    @PlayingCode 2 года назад +2

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

  • @guneyfatma
    @guneyfatma 9 месяцев назад +1

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

  • @laxpanwar11
    @laxpanwar11 Месяц назад

    Thanks. It is really informative.

  • @SoHoodTwentyThree
    @SoHoodTwentyThree 3 года назад

    Hi, i am working on a Bank Churners project and want to predict if a bank customer is leaving the services or not. I am asked to test a few different machine learning models and i want to know if logistic regression is suitable for a prediction model using 4 independent variables. I am thinking of using SVM and Random Forest too. What is your opinion ?

  • @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].

  • @sundayhonesty5828
    @sundayhonesty5828 5 лет назад

    Thank you Codebasicd for helping me understand Linear regression. I have question for Codebasics and everyone. please do well to answer me. thanks in advance.
    I want to perform a logistic regression. I was asked to use state and political party and vote gotten as my independent variable and make a prediction whether a political party wins or loses. I have 36 states in my country and i want to use 3 dominant parties i want to use as a case study. my problem is how the layout of these data will be; I am unable to resolve party been in a separate column unless I take one political party and take one state and do the prediction explicitly and then move on to another.
    Please i really needs you guys help to resolve these issue. Thanks in advance.