1 / 36

Logistic Regression in Python | Logistic Regression Example | Machine Learning Algorithms | Edureka

** Python Data Science Training : https://www.edureka.co/python ** <br>This Edureka Video on Logistic Regression in Python will give you basic understanding of Logistic Regression Machine Learning Algorithm with examples. In this video, you will also get to see demo on Logistic Regression using Python. Below are the topics covered in this tutorial: <br><br>1. What is Regression? <br>2. What is Logistic Regression? <br>3. Why use Logistic Regression? <br>4. Linear vs Logistic Regression <br>5. Logistic Regression Use Cases <br>6. Logistic Regression Example Demo in Python <br><br>Subscribe to our channel to get video updates. Hit the subscribe button above. <br><br>Machine Learning Tutorial Playlist: https://goo.gl/UxjTxm

EdurekaIN
Download Presentation

Logistic Regression in Python | Logistic Regression Example | Machine Learning Algorithms | Edureka

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. python Data Science Certification Training www.edureka.co/python

  2. Topics Covered in Today’s Training What is Regression? Logistic regression: What and Why? Linear Vs Logistic Regression Use- Cases Demo Data Science Certification Training www.edureka.co/python

  3. What Is Regression Copyright © 2018, edureka and/or its affiliates. All rights reserved.

  4. What is Regression? Regression Analysis is a predictive modelling technique It estimates the relationship between a dependent (target) and an independent variable(predictor) Data Science Certification Training www.edureka.co/python

  5. Logistic Regression: What And Why Copyright © 2018, edureka and/or its affiliates. All rights reserved.

  6. Logistic Regression: What And Why? Logistic Regression produces results in a binary format which is used to predict the outcome of a categorical dependent variable. So the outcome should be discrete/ categorical such as: 0 OR 1 Reduced Costs Improved Accuracy Yes OR No No Downtime. 24/7 up and running True OR False No Code required to implement RPA High And Low Data Science Certification Training www.edureka.co/python

  7. Why Not Linear Regression? 1 Since our value of Y will be between 0 and 1, the linear line has to be clipped at 0 and 1. Y-axis 0 X-axis Data Science Certification Training www.edureka.co/python

  8. Why Not Linear Regression? 1 With this, our resulting curve cannot be formulated into a single formula. Hence we came up with Logistic! Y-axis 0 X-axis Data Science Certification Training www.edureka.co/python

  9. Logistic Regression Curve The Sigmoid “S” Curve Data Science Certification Training www.edureka.co/python

  10. Logistic Regression Curve The Sigmoid “S” Curve THRESHOLD VALUE 0.5 With this, the threshold value indicates the probability of winning or losing Data Science Certification Training www.edureka.co/python

  11. Logistic Regression Equation The Logistic Regression Equation is derived from the Straight Line Equation Equation of a straight line Range is from –(infinity) to (infinity) Y = C + BIX1 + B2X2 +…. Data Science Certification Training www.edureka.co/python

  12. Logistic Regression Equation The Logistic Regression Equation is derived from the Straight Line Equation Equation of a straight line Range is from –(infinity) to (infinity) Y = C + BIX1 + B2X2 +…. Let’s try to reduce the Logistic Regression Equation from Straight Line Equation Y = C + BIX1 + B2X2 +…. In Logistic equation Y can be only from 0 to 1 Data Science Certification Training www.edureka.co/python

  13. Logistic Regression Equation The Logistic Regression Equation is derived from the Straight Line Equation Equation of a straight line Range is from –(infinity) to (infinity) Y = C + BIX1 + B2X2 +…. Let’s try to reduce the Logistic Regression Equation from Straight Line Equation Y = C + BIX1 + B2X2 +…. In Logistic equation Y can be only from 0 to 1 Now , to get the range of Y between 0 and infinity, let’s transform Y Y= 0 then 0 Y= 1 then infinity Y 1-Y Now, the range is between 0 to infinity Data Science Certification Training www.edureka.co/python

  14. Logistic Regression Equation The Logistic Regression Equation is derived from the Straight Line Equation Equation of a straight line Range is from –(infinity) to (infinity) Y = C + BIX1 + B2X2 +…. Let’s try to reduce the Logistic Regression Equation from Straight Line Equation Y = C + BIX1 + B2X2 +…. In Logistic equation Y can be only from 0 to 1 Now , to get the range of Y between 0 and infinity, let’s transform Y Y= 0 then 0 Y= 1 then infinity Y 1-Y Now, the range is between 0 to infinity Let us transform it further, to get range between –(infinity) and (infinity) Y 1-Y log Y = C + BIX1 + B2X2 +…. Final Logistic Regression Equation Data Science Certification Training www.edureka.co/python

  15. Linear Logistic Copyright © 2018, edureka and/or its affiliates. All rights reserved.

  16. Linear Vs Logistic Regression Linear Regression Logistic Regression 1 Continuous variables Categorical variables 1 2 Solves Classification Problems Solves Regression Problems 2 3 3 Straight line S-Curve Data Science Certification Training www.edureka.co/python

  17. Logistic Regression: Use - Cases Copyright © 2018, edureka and/or its affiliates. All rights reserved.

  18. Logistic Regression: Use - Cases Weather Predictions Data Science Certification Training www.edureka.co/python

  19. Logistic Regression: Use - Cases Classification Problems Data Science Certification Training www.edureka.co/python

  20. Logistic Regression: Use - Cases Determines Illness Data Science Certification Training www.edureka.co/python

  21. Demo Copyright © 2018, edureka and/or its affiliates. All rights reserved.

  22. Titanic Data Analysis 1 1 Explore titanic dataset and explore about the people, both those who survived and those who did not. With today's technology, answering questions through data analysis is now easier than ever. What factors made people more likely to survive the sinking of the Titanic? Data Science Certification Training www.edureka.co/python

  23. Titanic Dataset Data Science Certification Training www.edureka.co/python

  24. Implement Logistic Regression 1 Collecting Data 2 Analyzing Data 3 Data Wrangling 4 Train & Test 5 Accuracy Check Data Science Certification Training www.edureka.co/python

  25. Implement Logistic Regression Collect Data: Import Libraries 1 1 2 3 4 5 Data Science Certification Training www.edureka.co/python

  26. Implement Logistic Regression 1 1 Creating different plot to check relationship between variables Analyzing Data 2 2 3 4 5 Data Science Certification Training www.edureka.co/python

  27. Implement Logistic Regression 1 2 Creating different plot to check relationship between variables Analyzing Data 3 3 4 5 Data Science Certification Training www.edureka.co/python

  28. Implement Logistic Regression 1 2 Clean the data by removing the Nan values and unnecessary columns in the dataset Data Wrangling 3 3 4 5 Data Science Certification Training www.edureka.co/python

  29. Implement Logistic Regression 1 2 3 Build the model on the train data and predict the output on the test data Train & Test Data 4 4 5 logistic = LogisticRegression() logistic.fit(train_X,train_Y) Data Science Certification Training www.edureka.co/python

  30. Implement Logistic Regression 1 2 3 4 Calculate accuracy to check how accurate your results are. Accuracy Check 5 from sklearn.metrics import accuracy_score accuracy_score(y_test,predictions)*100 Data Science Certification Training www.edureka.co/python

  31. SUV Data Analysis 1A car company has released a new SUV in the market. Using the previous data about the sales of their SUV’s, they want to predict the category of people who might be interested in buying this. 2 What factors made people more interested in buying SUV? Data Science Certification Training www.edureka.co/python

  32. SUV Predictions Data Science Certification Training www.edureka.co/python

  33. Session in a Minute What is regression? Logistic: What & Why? Linear VS Logistic Linear Regression Logistic Regression Reduced Costs 0 And 1 Improved Accuracy Yes And No 1 Categorical variables 1 Continuous variables No Downtime. 24/7 up and running True And False 2 Solves Classification Problems Solves Regression Problems 2 3 3 Straight line Curve S-Curve No Code required to implement RPA High And Low Use - Cases Demo2: SUV Prediction Demo1: Titanic Analysis Data Science Certification Training www.edureka.co/python

  34. Don’t just learn it, MASTER it with Copyright © 2018, edureka and/or its affiliates. All rights reserved.

More Related