{"id":8458,"date":"2021-09-16T22:52:19","date_gmt":"2021-09-16T22:52:19","guid":{"rendered":"https:\/\/wealthrevelation.com\/data-science\/2021\/09\/16\/the-basics-of-logistic-regression-in-data-science\/"},"modified":"2021-09-16T22:52:19","modified_gmt":"2021-09-16T22:52:19","slug":"the-basics-of-logistic-regression-in-data-science","status":"publish","type":"post","link":"https:\/\/wealthrevelation.com\/data-science\/2021\/09\/16\/the-basics-of-logistic-regression-in-data-science\/","title":{"rendered":"The Basics of Logistic Regression in Data Science"},"content":{"rendered":"<div>\n<p>Data science is a field that is growing by leaps and bounds. A couple decades ago, using a machine learning program to make predictions about datasets was the purview of science fiction. Today, all you need is a computer, some solid programming, and a bit of patience, and you, too, can have your own digital <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fortune_teller_machine\">Zoltar<\/a>.<\/p>\n<p>Okay, it\u2019s not really telling the future, but it does give you the ability to predict some future events, as long as those events fall within the data the system already has. These predictions fall into two categories: <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2020\/12\/beginners-take-how-logistic-regression-is-related-to-linear-regression\/#:~:text=The%20Differences%20between%20Linear%20Regression,Logistic%20regression%20provides%20discreet%20output.\">linear regression and logistic regression<\/a>.<\/p>\n<p>Today we\u2019re going to focus on the latter. What is logistic regression in data science, and how can it help data scientists and analysts solve problems?<\/p>\n<h2><strong>What Is Logistic Regression?<\/strong><\/h2>\n<p>First, what is logistic regression, and <a href=\"https:\/\/www.javatpoint.com\/linear-regression-vs-logistic-regression-in-machine-learning\">how does it compare<\/a> to its linear counterpart?<\/p>\n<p>Logistic regression is defined as \u201ca statistical analysis method used to predict a data value based on prior observations of a data set.\u201d It is valuable for predicting the result if it is dichotomous, meaning there are only two possible outcomes.<\/p>\n<p>For example, a logistic regression system could use its data set to predict whether a specific team will win a game, based on their previous performance and the performance of their competitors because there are only two possible outcomes \u2014 a win or a loss.<\/p>\n<p>Linear regression, on the other hand, is better suited for continuous output or situations where there are more than two possible outcomes. A traffic prediction model would use linear regression. In these situations, no matter how much data the program has, there are always variables that can throw a wrench in the works.<\/p>\n<p>This isn\u2019t just a case of \u201cgo\u201d or \u201cno go,\u201d like you might see with a rocket launch. A company using these <a href=\"https:\/\/expressitdelivery.com\/industries\/healthcare-delivery\/\">predictive models to schedule deliveries<\/a> will need to be able to compensate for those variables. Linear regression gives them the flexibility to do that.<\/p>\n<h2><strong>Logistic Regression in Data Analysis<\/strong><\/h2>\n<p>If you broke down the <a href=\"https:\/\/medium.com\/data-science-group-iitr\/logistic-regression-simplified-9b4efe801389\">expression of logistic regression<\/a> on paper, it would look something like this:<\/p>\n<p><a href=\"https:\/\/data-science-blog.com\/en\/wp-content\/uploads\/sites\/4\/2021\/08\/logit-formula.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-5724\" src=\"https:\/\/data-science-blog.com\/en\/wp-content\/uploads\/sites\/4\/2021\/08\/logit-formula.png\" alt=\"\" width=\"173\" height=\"48\"><\/a>The left side of the equation is called a logit, while the right side represents the odds, or the probability of success vs. failure.<\/p>\n<p>It seems incredibly complicated, but when you break it down and feed it into a machine learning algorithm, it provides a great number of benefits. For one, it\u2019s simple \u2014 in relative terms \u2014 and doesn\u2019t generate a lot of variance because, at the end, no matter how much data you feed a logistic regression system, there are only going to be two possible outcomes.<\/p>\n<p>In addition to providing you with a \u201cyes\u201d or \u201cno\u201d answer, these systems can also provide the probability for each potential outcome. The downside of logistic regression systems is that they don\u2019t function well if you feed them too many different variables. They will also need an additional translator system to convert non-linear features to linear ones.<\/p>\n<h2><strong>Applications of Logistic Regression<\/strong><\/h2>\n<p>The potential applications for logistic regression are nearly limitless. But if you find yourself struggling to picture where you might use this data analysis tool, <a href=\"https:\/\/activewizards.com\/blog\/5-real-world-examples-of-logistic-regression-application\">here are a few examples<\/a> that might help you.<\/p>\n<p>Organizations can use logistic regression for credit scoring. While this might seem like it\u2019s outside the scope of this particular type of programming because there are multiple credit scores a person might have, when you break it down to ones and zeros, there are usually only two possible outcomes where credit is concerned \u2014 approved or denied.<\/p>\n<p>There are a number of potential applications for logistic regression in medicine as well. When it comes to testing for a specific condition, there are usually only two results \u2014 \u201cyes\u201d or \u201cno.\u201d Either the patient has the condition, or they don\u2019t. In this case, it may be necessary to program in a third option \u2014 a null variable \u2014 that trips when there isn\u2019t enough information available for a particular patient to make an accurate diagnostic decision.<\/p>\n<p>Even text editing can benefit from logistic regression. Plug in a dictionary, and let it loose on a piece of text. These programs aren\u2019t going to create masterpieces or even fix editing mistakes because they lack the programming to understand things like context and tone, but they are invaluable for spelling mistakes. Again, this brings us back to the binary of 1\u2019s and 0\u2019s \u2014 either a word is spelled correctly, according to the dictionary definition, or it isn\u2019t.<\/p>\n<p>If dichotomous outcomes are the goal of your data analysis system, logistic regression is going to be the best tool in your toolbox.<\/p>\n<h2><strong>Breaking Down the Basics<\/strong><\/h2>\n<p>A lot goes into the creation of a machine learning or predictive analysis tool, but understanding the difference between linear and logistic regression can make that process a bit simpler. Start by understanding what the program will do, then choose your regression form appropriately.<\/p>\n<div id=\"author-bio-box\">\n<h3><a href=\"https:\/\/data-science-blog.com\/en\/blog\/author\/shannonflynn\/\" title=\"All posts by Shannon Flynn\" rel=\"author\">Shannon Flynn<\/a><\/h3>\n<div class=\"bio-gravatar\"><img alt=\"\" src=\"https:\/\/secure.gravatar.com\/avatar\/04a77e2404147f025f6ed0f280b214df?s=70&amp;d=mm&amp;r=g\" class=\"avatar avatar-70 photo\" height=\"70\" width=\"70\" loading=\"lazy\"><\/div>\n<p class=\"bio-description\">Shannon is a technology blogger who writes about IT trends, cybersecurity, and biztech news. She&#8217;s also the Managing Editor at ReHack.com. Follow ReHack on Twitter to read more from Shannon about other technology updates.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/data-science-blog.com\/en\/blog\/2021\/08\/31\/the-basics-of-logistic-regression-in-data-science\/<\/p>\n","protected":false},"author":0,"featured_media":8459,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8458"}],"collection":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/comments?post=8458"}],"version-history":[{"count":0,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8458\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media\/8459"}],"wp:attachment":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media?parent=8458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/categories?post=8458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/tags?post=8458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}