{"id":845,"date":"2019-01-07T16:35:10","date_gmt":"2019-01-07T11:05:10","guid":{"rendered":"http:\/\/blog.tenthplanet.in\/?p=845"},"modified":"2026-07-03T12:52:36","modified_gmt":"2026-07-03T07:22:36","slug":"logistic-regression-an-overview","status":"publish","type":"post","link":"https:\/\/tenthplanet.in\/blogs\/logistic-regression-an-overview\/","title":{"rendered":"Using Logistic Regression to predict Loan Defaults"},"content":{"rendered":"<h3>I. Overview to Predict Loan Defaults<\/h3>\n<p>Logistic Regression can be used to predict the likelihood of an outcome based on the input variables. Logistic regression is generally used where the dependent variable is Binary or Dichotomous. That means the dependent variable can take only two possible values such as \u201cYes or No\u201d, \u201cDefault or No Default\u201d, \u201cLiving or Dead\u201d, \u201cResponder or Non Responder\u201d, \u201cYes or No\u201d etc. Independent factors or variables can be categorical or numerical variables.<\/p>\n<p>Do note that even though logistic regression is frequently used for binary variables (2 classes), it can be used for categorical dependent variables with more than 2 classes. In this case it\u2019s called Multinomial Logistic Regression. Logistic Regression relationship can be expressed as shown in the below provided equation;<\/p>\n<h4 class=\"western\" lang=\"en-US\" align=\"center\"><span style=\"color: #006699\"><span style=\"font-size: large\">f(y) = e<sup>y <\/sup>\/ 1 + e<sup>y<\/sup> , for &#8211;<span style=\"font-family: Ubuntu Condensed\">\u221e<\/span><span style=\"font-family: Liberation Serif, Times New Roman, serif\">&lt;y&lt;<\/span><span style=\"font-family: Ubuntu Condensed\">\u221e<\/span><\/span><\/span><\/h4>\n<p lang=\"en-US\" align=\"center\">Note, that as <strong>y \u2192 \u221e, f(y) \u2192 1, and as y \u2192 -\u221e, f(y) \u2192 0<\/strong>. The value of the logistic function <strong>f(y)<\/strong> varies from <strong>0<\/strong> to <strong>1<\/strong> as <strong>y<\/strong> increases. This is demonstrated in the image represented below;<\/p>\n<p lang=\"en-US\" style=\"text-align: center\" align=\"justify\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-846\" src=\"https:\/\/tenthplanet.in\/blogs\/wp-content\/uploads\/sites\/21\/2019\/01\/logistic-function1-300x154.png\" alt=\"\" width=\"413\" height=\"212\" title=\"\" srcset=\"https:\/\/tenthplanet.in\/blogs\/wp-content\/uploads\/sites\/21\/2019\/01\/logistic-function1-300x154.png 300w, https:\/\/tenthplanet.in\/blogs\/wp-content\/uploads\/sites\/21\/2019\/01\/logistic-function1.png 535w\" sizes=\"auto, (max-width: 413px) 100vw, 413px\" \/><\/p>\n<p lang=\"en-US\" align=\"justify\">Moreover, in logistic regression, <strong>y<\/strong> is expressed as a linear function of the input variables. In other words, the formula given above can be represented as the equation mentioned below;<\/p>\n<p class=\"western\" lang=\"en-US\" align=\"center\"><span style=\"font-size: large\"><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b>y = <\/b><\/span><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b>\u03b2<\/b><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><b>0 <\/b><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b>+ <\/b><\/span><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b>\u03b2<\/b><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><b>1<\/b><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b>X<\/b><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><b>1<\/b><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b> + \u03b2<\/b><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><b>2<\/b><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b>X<\/b><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><b>2<\/b><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b> + \u2026. + \u03b2<\/b><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><b>p-1<\/b><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><b>X<\/b><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><b>p-1<\/b><\/span><\/sub><\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"text-align: left\" align=\"center\">The above equation is comparable to linear regression model, however, one difference is that the values of y are not directly observed. Only the value of <strong>f(y)<\/strong> in terms of success or failure is observed. Using p to denote <strong>f(y)<\/strong>, we can further modify the equation as provided below;<\/p>\n<p class=\"western\" lang=\"en-US\" align=\"center\"><span style=\"font-size: medium\"><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>ln(p\/1-p) = y = <\/b><\/span><\/span><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>\u03b2<\/b><\/span><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>0 <\/b><\/span><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>+ <\/b><\/span><\/span><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>\u03b2<\/b><\/span><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>1<\/b><\/span><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>X<\/b><\/span><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>1<\/b><\/span><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b> + \u03b2<\/b><\/span><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>2<\/b><\/span><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>X<\/b><\/span><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>2<\/b><\/span><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b> + \u2026. + \u03b2<\/b><\/span><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>p-1<\/b><\/span><\/span><\/sub><\/span><span style=\"color: #006699\"><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>X<\/b><\/span><\/span><\/span><span style=\"color: #006699\"><sub><span style=\"font-family: FreeSans, sans-serif\"><span style=\"font-size: large\"><b>p-1<\/b><\/span><\/span><\/sub><\/span><\/span><\/p>\n<p>The quantity <strong>ln(p\/1-p),<\/strong> is known as the log odds ratio, or the logit of <strong>p<\/strong>. Techniques such as Maximum Likelihood Estimation (MLE) are used to estimate the model parameters.<\/p>\n<h3>II. Example Use Cases<\/h3>\n<p>The logistic regression model is applied to a variety of situations in both the public and the private sector. Some common ways that the logistic regression model is used include the following:<\/p>\n<ul>\n<li><strong>Medical :<\/strong> Develop a model to determine the likelihood of a patient&#8217;s successful response to a specific medical treatment or procedure. Input variables could include age, weight, blood pressure, and cholesterol levels.<\/li>\n<li><strong>Finance :<\/strong> Risk Assessment &#8211; Using a loan applicant &#8216;s credit history and the details on the loan, determine the probability that an applicant will default on the loan. Based on the prediction, the loan can be approved or denied, or the terms can be modified.<\/li>\n<li><strong>Marketing :<\/strong> Churn Prediction &#8211; Determine a wireless customer&#8217;s probability of switching carriers (known as churning) based on age, number of family members on the plan, months remaining on the existing contract, and social network contacts. With such insight, target the high-probability customers with appropriate offers to prevent churn.<\/li>\n<li><strong>Engineering :<\/strong> Based on operating conditions and various diagnostic measurements, determine the probability of a mechanical part experiencing a malfunction or failure. With this probability estimate, schedule the appropriate preventive maintenance activity.<\/li>\n<\/ul>\n<h3>III. Conclusion<\/h3>\n<h4>To summarize logistic regression:<\/h4>\n<ul>\n<li>The aim of a Logistic Regression is to model the probability of an event that occurs depending on the values of the independent variables.<\/li>\n<li>A Logistic Regression classifies observations by estimating the probability that an observation is in a particular category.<\/li>\n<li>A Logistic Regression estimates the probability that an event occurs for a randomly selected observation versus the probability of this event not occurring at all.<\/li>\n<\/ul>\n<p lang=\"en-US\" align=\"justify\">\n","protected":false},"excerpt":{"rendered":"<p>A Logistic Regression classifies observations by estimating the probability that an observation is in a particular category. <\/p>\n","protected":false},"author":23,"featured_media":1141,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[424],"tags":[468,490,491,474,483],"class_list":["post-845","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pentaho","tag-data-science","tag-logistic-regression","tag-logit","tag-machine-learning","tag-r"],"acf":[],"_links":{"self":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/posts\/845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/comments?post=845"}],"version-history":[{"count":1,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/posts\/845\/revisions"}],"predecessor-version":[{"id":11321,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/posts\/845\/revisions\/11321"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/media\/1141"}],"wp:attachment":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/media?parent=845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/categories?post=845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/tags?post=845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}