{"id":2944,"date":"2021-10-17T20:28:52","date_gmt":"2021-10-17T23:28:52","guid":{"rendered":"https:\/\/waisdata.com\/?post_type=blog-wais&#038;p=2944"},"modified":"2022-12-15T09:52:50","modified_gmt":"2022-12-15T12:52:50","slug":"modelos-de-clasificacion-bajo-un-contexto-empresarial","status":"publish","type":"blog-wais","link":"https:\/\/waisdata.com\/en\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/","title":{"rendered":"Classification model in a business context"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"2944\" class=\"elementor elementor-2944\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-39eeab4 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"39eeab4\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b6e7a0a\" data-id=\"b6e7a0a\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d07058b elementor-widget elementor-widget-heading\" data-id=\"d07058b\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Classification model in a business context<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-324c44a elementor-widget elementor-widget-heading\" data-id=\"324c44a\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">2021-10-17<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c89b15c elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"c89b15c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9386cc9\" data-id=\"9386cc9\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-110f8e9 elementor-widget elementor-widget-text-editor\" data-id=\"110f8e9\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><h3>Motivation<\/h3><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-934fc29 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"934fc29\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-840f5ed\" data-id=\"840f5ed\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0b99e23 elementor-widget elementor-widget-text-editor\" data-id=\"0b99e23\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><span style=\"font-weight: 400;\">Classification problems are the most frequent use cases encountered in the real world. Unlike regression problems, where an actual numerical value is predicted, classification problems attempt to associate an example with a category. Classification problems can be further divided into binary or multiclass classification. The former are used when what is to be predicted or classified has only two possible outcomes, while the latter refer to three or more possible outcomes or categories.<\/span><\/p><p><span style=\"font-weight: 400;\">Some examples for which a binary classification model would be used are as follows:<\/span><\/p><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Predict whether or not a customer will buy a certain product.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Predict whether or not a customer will churn.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Determine whether or not a student will pass an exam.<\/span><\/li><\/ul><p><span style=\"font-weight: 400;\">On the other hand, we would use a multi-class classification model for:\u00a0<\/span><\/p><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Analyse text comments and capture the underlying emotion, such as happiness, anger, sadness or sarcasm.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Predict whether a team will win, draw or lose the next match.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Analyse images of fruit and classify them into three different categories according to the degree of aesthetic quality.<\/span><\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-07fadd5 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"07fadd5\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6943d42\" data-id=\"6943d42\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-60cdce1 elementor-widget elementor-widget-text-editor\" data-id=\"60cdce1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><h3>Business context<\/h3><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4712f80 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"4712f80\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-aedbde6\" data-id=\"aedbde6\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d23af87 elementor-widget elementor-widget-text-editor\" data-id=\"d23af87\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><span style=\"font-weight: 400;\">The best way to work with a concept is with an example to which it can be related. To understand the business context, consider the following example:<\/span><\/p><p><span style=\"font-weight: 400;\">The marketing team of a bank wants to know the propensity of customers to purchase a certain investment product. To solve this problem, the probability of purchase of customers could be calculated to find out their propensity or inclination to purchase the product. In this way, customers could be segmented and marketing campaigns could be targeted to persuade those most likely to purchase the investment.\u00a0<\/span><\/p><p><span style=\"font-weight: 400;\">As mentioned in previous publications, the first step in a data science project is to understand the business. This is about understanding the various factors that influence the business problem. Knowing the drivers or levers of the business is important, as it will help formulate hypotheses about the business problem, which can be verified during exploratory data analysis.<\/span><\/p><p><span style=\"font-weight: 400;\">Knowing that the product to be offered tends to be popular with risk-averse customers, the following hypotheses could be made:<\/span><\/p><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Would age be a factor, with a greater propensity shown by older people?<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Is there any relationship between employment status and the propensity to purchase such an investment product?<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Would a customer's asset portfolio (housing, loan or higher bank balance) influence the propensity to buy?<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Will demographics, such as marital status and education, influence the propensity to purchase the product? If so, how do demographics correlate with propensity to buy?<\/span><\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4e4bddc elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"4e4bddc\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-70cab28\" data-id=\"70cab28\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6f8bd8a elementor-widget elementor-widget-text-editor\" data-id=\"6f8bd8a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><h3>Test the veracity of hypotheses with data<\/h3><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-97d35bb elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"97d35bb\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f7fab54\" data-id=\"f7fab54\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f67cd92 elementor-widget elementor-widget-text-editor\" data-id=\"f67cd92\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><span style=\"font-weight: 400;\">Based on the above, an exploratory data analysis would help us to test the veracity of the hypotheses raised with data. As an example, the following hypothesis could be defined:\u00a0<\/span><\/p><p><i><span style=\"font-weight: 400;\">The propensity to buy the investment product is higher for older customers than for younger ones.<\/span><\/i><\/p><p><span style=\"font-weight: 400;\">We could chart the number of people who buy the product according to their age to see if there is a pattern that reflects our hypothesis.\u00a0 <\/span><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0d4132d elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"0d4132d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b841983\" data-id=\"b841983\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8ab8fe7 elementor-widget elementor-widget-text-editor\" data-id=\"8ab8fe7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><img class=\"alignnone size-full wp-image-2953 aligncenter\" src=\"https:\/\/waisdata.com\/wp-content\/uploads\/2021\/10\/visualization-3.svg\" alt=\"\" \/><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f635a45 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"f635a45\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-229cdfd\" data-id=\"229cdfd\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c9aed43 elementor-widget elementor-widget-text-editor\" data-id=\"c9aed43\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><span style=\"font-weight: 400;\">From the graph we can see that the highest number of purchases of the investment product is made by customers between 25 and 40 years old, and that the propensity to buy decreases with age.\u00a0<\/span><\/p><p><span style=\"font-weight: 400;\">However, we are overlooking an important detail here, we are taking the data based on the absolute count of clients in each age range. If the proportion of bank clients is highest in the 25-40 age range, then we are likely to get a graph like the one we have obtained. What we should really be plotting is the proportion of customers, within each age group, who buy the product in question.<\/span><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ca79d94 elementor-widget elementor-widget-text-editor\" data-id=\"ca79d94\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><h3><img class=\"size-full wp-image-2952 aligncenter\" src=\"https:\/\/waisdata.com\/wp-content\/uploads\/2021\/10\/visualization-4.svg\" alt=\"\" \/><\/h3><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-65f9f59 elementor-widget elementor-widget-text-editor\" data-id=\"65f9f59\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><span style=\"font-weight: 400;\">We can see, in the graph on the left, that in the age group from 22 years (approx.) to 60 years, individuals are not inclined to buy the product. However, in the graph on the right, we see the opposite, where the 60+ age group is much more inclined to buy the product.\u00a0<\/span><\/p><p><span style=\"font-weight: 400;\">Taking the proportion of users is the right approach to get the right perspective in which to view the data. This is more in line with the hypothesis we have put forward.<\/span><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b7e2a40 elementor-widget elementor-widget-text-editor\" data-id=\"b7e2a40\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><h3>Predecir la probabilidad de compra con Regresi\u00f3n Log\u00edstica<\/h3><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b9fbae9 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"b9fbae9\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-630a89a\" data-id=\"630a89a\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7353ef5 elementor-widget elementor-widget-text-editor\" data-id=\"7353ef5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><span style=\"font-weight: 400;\">While there are several steps between the exploratory analysis and the application of a model (such as preprocess the data for input to the algorithm, creating new variables to help improve the predictive capacity of the model, etc.), the focus of the publication is to address a classification model in a business context. That is why we will now explain how a Logistic Regression works and how it would be adapted to the business objective in question. The desired business outcome, in our use case, is to identify the customers who are likely to buy the product.\u00a0\u00a0<\/span><\/p><p><span style=\"font-weight: 400;\">On the other hand, the goal of machine learning is to estimate a mapping function (f) between an output variable and the input variables. In mathematical form, this can be written as follows:<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">Y = f(X)<\/span><\/p><p><span style=\"font-weight: 400;\">Y it is the dependent variable, which is our prediction of whether a customer is likely to buy the product or not.<\/span><\/p><p><span style=\"font-weight: 400;\">X is the independent variable(s), which are those attributes such as age, education, bank balance, asset portfolio, etc. that are part of the dataset.<\/span><\/p><p><span style=\"font-weight: 400;\">f() is a function that relates various attributes of the data to the probability that a customer will or will not buy the product. This function is learned during the machine learning process. This function is a combination of different coefficients or parameters applied to each of the attributes (or variables) to obtain the probability of purchase.<\/span><\/p><p><span style=\"font-weight: 400;\">For simplicity, let's assume we have only two attributes, age and bank balance. Let's assume the age is 62 and the balance is $900. With all these attribute values, let's assume that the mapping equation is as follows<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Y = B0 + B1_Age * Age + B2_Bank_balance * Bank_balance<\/span><\/p><p><span style=\"font-weight: 400;\">Using the above equation, we obtain the following:<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">Y = 0.1 + 0.4 * 62 + 0.002 * 900<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">\u00a0Y = 26.7<\/span><\/p><p><span style=\"font-weight: 400;\">We see that the equation used corresponds to the Linear Regression we saw in the previous publication, and that the output gives us a real number. This is where Logistic Regression comes in, which is similar to Linear Regression, but applies a sigmoid function that reduces any real-valued number to a value between 0 and 1, which makes this function ideal for predicting probabilities.\u00a0<\/span><\/p><p><span style=\"font-weight: 400;\">To transform the real-valued output into a probability, we use the logistic function, which has the following form:<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">Y =\u00a0 (e^(X))\/(1 + e^(X))<\/span><\/p><p><span style=\"font-weight: 400;\">Here \"e\" is the natural logarithm.<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span> <span style=\"font-weight: 400;\">Y = (e^(B0 + B1*X1 + B2*X2))\/(1 + e^(B0 + B1*X1 + B2*X2))<\/span><\/p><p><span style=\"font-weight: 400;\">Let us now look at the logistic regression function from the business problem we are trying to solve.<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">Y = (e^(B0 + B1_Age * Age + B2_Bank_balance * Bank_balance))\/<\/span><span style=\"font-weight: 400;\">(1 + e^(B0 + B1_Age * Age + B2_BankBalance * BankBalance))<\/span><\/p><p style=\"text-align: center;\"><span style=\"font-weight: 400;\">Y = (e^(0.1 + 0.4*62 + 0.02*900))\/(1 + e^(0.1 + 0.4*62 + 0.02*900))<\/span><\/p><p><span style=\"font-weight: 400;\">By applying this, we obtain a value of Y = 0.76 , which is a 76% probability that the customer will buy the investment product. As discussed in the previous example, model coefficients such as 0.1, 0.4 and 0.002 are the ones we learn using the logistic regression algorithm during the training process.<\/span><\/p><p><span style=\"font-weight: 400;\">So far we have addressed issues such as: when to use a classification model, defining a business objective, posing and testing the veracity of a hypothesis from exploratory analysis, and finally applying the concept of logistic regression to the business problem. In the next publication we will focus on different measures to evaluate the performance of classification models.<\/span><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-835a94a elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"835a94a\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ed4fa8c\" data-id=\"ed4fa8c\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-47aba25 elementor-widget elementor-widget-heading\" data-id=\"47aba25\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Published by<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-037712d elementor-widget elementor-widget-heading\" data-id=\"037712d\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Wais<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Classification problems are the most frequent use cases encountered in the real world. Unlike regression problems, where an actual numerical value is predicted, classification problems attempt to associate an example with a category. <\/p>","protected":false},"author":13,"featured_media":2947,"comment_status":"open","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[12],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>#WaisBlog: Modelo de Clasificaci\u00f3n bajo un contexto empresarial | Ciencia de datos<\/title>\n<meta name=\"description\" content=\"La Regresi\u00f3n es uno de los m\u00e9todos clave que se utilizan regularmente en la ciencia de los datos, con el fin de modelar las relaciones entre las variables, donde la variable objetivo es un n\u00famero continuo\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/waisdata.com\/en\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"#WaisBlog: Modelo de Clasificaci\u00f3n bajo un contexto empresarial | Ciencia de datos\" \/>\n<meta property=\"og:description\" content=\"La Regresi\u00f3n es uno de los m\u00e9todos clave que se utilizan regularmente en la ciencia de los datos, con el fin de modelar las relaciones entre las variables, donde la variable objetivo es un n\u00famero continuo\" \/>\n<meta property=\"og:url\" content=\"https:\/\/waisdata.com\/en\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/\" \/>\n<meta property=\"og:site_name\" content=\"Wais\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-15T12:52:50+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/waisdata.com\/wp-content\/uploads\/2021\/10\/Imagenes-Redes-2.svg\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/\"},\"author\":{\"name\":\"Wais\",\"@id\":\"https:\/\/waisdata.com\/#\/schema\/person\/238aa97a70c2cb314a793d302e121db5\"},\"headline\":\"Modelo de Clasificaci\u00f3n bajo un contexto empresarial\",\"datePublished\":\"2021-10-17T23:28:52+00:00\",\"dateModified\":\"2022-12-15T12:52:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/\"},\"wordCount\":1534,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/waisdata.com\/#organization\"},\"articleSection\":[\"Inteligencia artificial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/\",\"url\":\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/\",\"name\":\"#WaisBlog: Modelo de Clasificaci\u00f3n bajo un contexto empresarial | Ciencia de datos\",\"isPartOf\":{\"@id\":\"https:\/\/waisdata.com\/#website\"},\"datePublished\":\"2021-10-17T23:28:52+00:00\",\"dateModified\":\"2022-12-15T12:52:50+00:00\",\"description\":\"La Regresi\u00f3n es uno de los m\u00e9todos clave que se utilizan regularmente en la ciencia de los datos, con el fin de modelar las relaciones entre las variables, donde la variable objetivo es un n\u00famero continuo\",\"breadcrumb\":{\"@id\":\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/waisdata.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Modelo de Clasificaci\u00f3n bajo un contexto empresarial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/waisdata.com\/#website\",\"url\":\"https:\/\/waisdata.com\/\",\"name\":\"Wais\",\"description\":\"Data driven solutions\",\"publisher\":{\"@id\":\"https:\/\/waisdata.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/waisdata.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/waisdata.com\/#organization\",\"name\":\"Wais Data Science\",\"url\":\"https:\/\/waisdata.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/waisdata.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/waisdata.com\/wp-content\/uploads\/2020\/10\/logo-wais600x600.svg\",\"contentUrl\":\"https:\/\/waisdata.com\/wp-content\/uploads\/2020\/10\/logo-wais600x600.svg\",\"caption\":\"Wais Data Science\"},\"image\":{\"@id\":\"https:\/\/waisdata.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/ar.linkedin.com\/company\/wais-data\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/waisdata.com\/#\/schema\/person\/238aa97a70c2cb314a793d302e121db5\",\"name\":\"Wais\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/waisdata.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5cd57b55c506fa8638830ad7206866c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5cd57b55c506fa8638830ad7206866c8?s=96&d=mm&r=g\",\"caption\":\"Wais\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"#WaisBlog: Modelo de Clasificaci\u00f3n bajo un contexto empresarial | Ciencia de datos","description":"La Regresi\u00f3n es uno de los m\u00e9todos clave que se utilizan regularmente en la ciencia de los datos, con el fin de modelar las relaciones entre las variables, donde la variable objetivo es un n\u00famero continuo","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/waisdata.com\/en\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/","og_locale":"en_US","og_type":"article","og_title":"#WaisBlog: Modelo de Clasificaci\u00f3n bajo un contexto empresarial | Ciencia de datos","og_description":"La Regresi\u00f3n es uno de los m\u00e9todos clave que se utilizan regularmente en la ciencia de los datos, con el fin de modelar las relaciones entre las variables, donde la variable objetivo es un n\u00famero continuo","og_url":"https:\/\/waisdata.com\/en\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/","og_site_name":"Wais","article_modified_time":"2022-12-15T12:52:50+00:00","twitter_card":"summary_large_image","twitter_image":"https:\/\/waisdata.com\/wp-content\/uploads\/2021\/10\/Imagenes-Redes-2.svg","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#article","isPartOf":{"@id":"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/"},"author":{"name":"Wais","@id":"https:\/\/waisdata.com\/#\/schema\/person\/238aa97a70c2cb314a793d302e121db5"},"headline":"Modelo de Clasificaci\u00f3n bajo un contexto empresarial","datePublished":"2021-10-17T23:28:52+00:00","dateModified":"2022-12-15T12:52:50+00:00","mainEntityOfPage":{"@id":"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/"},"wordCount":1534,"commentCount":1,"publisher":{"@id":"https:\/\/waisdata.com\/#organization"},"articleSection":["Inteligencia artificial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/","url":"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/","name":"#WaisBlog: Modelo de Clasificaci\u00f3n bajo un contexto empresarial | Ciencia de datos","isPartOf":{"@id":"https:\/\/waisdata.com\/#website"},"datePublished":"2021-10-17T23:28:52+00:00","dateModified":"2022-12-15T12:52:50+00:00","description":"La Regresi\u00f3n es uno de los m\u00e9todos clave que se utilizan regularmente en la ciencia de los datos, con el fin de modelar las relaciones entre las variables, donde la variable objetivo es un n\u00famero continuo","breadcrumb":{"@id":"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/waisdata.com\/blog-wais\/modelos-de-clasificacion-bajo-un-contexto-empresarial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/waisdata.com\/"},{"@type":"ListItem","position":2,"name":"Modelo de Clasificaci\u00f3n bajo un contexto empresarial"}]},{"@type":"WebSite","@id":"https:\/\/waisdata.com\/#website","url":"https:\/\/waisdata.com\/","name":"Wais","description":"Data driven solutions","publisher":{"@id":"https:\/\/waisdata.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/waisdata.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/waisdata.com\/#organization","name":"Wais Data Science","url":"https:\/\/waisdata.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/waisdata.com\/#\/schema\/logo\/image\/","url":"https:\/\/waisdata.com\/wp-content\/uploads\/2020\/10\/logo-wais600x600.svg","contentUrl":"https:\/\/waisdata.com\/wp-content\/uploads\/2020\/10\/logo-wais600x600.svg","caption":"Wais Data Science"},"image":{"@id":"https:\/\/waisdata.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/ar.linkedin.com\/company\/wais-data"]},{"@type":"Person","@id":"https:\/\/waisdata.com\/#\/schema\/person\/238aa97a70c2cb314a793d302e121db5","name":"Wais","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/waisdata.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5cd57b55c506fa8638830ad7206866c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5cd57b55c506fa8638830ad7206866c8?s=96&d=mm&r=g","caption":"Wais"}}]}},"_links":{"self":[{"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/blog-wais\/2944"}],"collection":[{"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/blog-wais"}],"about":[{"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/types\/blog-wais"}],"author":[{"embeddable":true,"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/comments?post=2944"}],"version-history":[{"count":14,"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/blog-wais\/2944\/revisions"}],"predecessor-version":[{"id":4273,"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/blog-wais\/2944\/revisions\/4273"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/media\/2947"}],"wp:attachment":[{"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/media?parent=2944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/categories?post=2944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/waisdata.com\/en\/wp-json\/wp\/v2\/tags?post=2944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}