{"id":3583,"date":"2014-07-27T11:19:09","date_gmt":"2014-07-27T05:49:09","guid":{"rendered":"http:\/\/ucanalytics.com\/blogs\/?p=3583"},"modified":"2016-10-13T14:28:51","modified_gmt":"2016-10-13T08:58:51","slug":"decision-tree-cart-retail-case-example-part-5","status":"publish","type":"post","link":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/","title":{"rendered":"Decision Tree (CART) &#8211; Retail Case Study Example (Part 5)"},"content":{"rendered":"<div id=\"attachment_3584\" style=\"width: 280px\" class=\"wp-caption alignright\"><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg\"><img aria-describedby=\"caption-attachment-3584\" data-attachment-id=\"3584\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/photo-1-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&amp;ssl=1\" data-orig-size=\"756,1008\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Greedy Decision Tree \u2013 by Roopam\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Greedy Decision Tree \u2013 by Roopam&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=225%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=640%2C853&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-3584\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?resize=270%2C360\" alt=\"Greedy Decision Tree - by Roopam \" width=\"270\" height=\"360\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?w=756&amp;ssl=1 756w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?resize=187%2C250&amp;ssl=1 187w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?resize=225%2C300&amp;ssl=1 225w\" sizes=\"(max-width: 270px) 100vw, 270px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-3584\" class=\"wp-caption-text\">Greedy Decision Tree &#8211; by Roopam<\/p><\/div>\n<hr \/>\n<p>This article is a continuation of the\u00a0retail case study example we have been working on for the last few weeks. You can find the previous 4 parts of the case at the following links:<\/p>\n<p>Part 1:\u00a0<a style=\"color: #ff9d73;\" href=\"http:\/\/ucanalytics.com\/blogs\/marketing-analytics-retail-case-study-part-1\/\">Introduction<\/a><br \/>\nPart 2:\u00a0<a style=\"color: #ff9d73;\" href=\"http:\/\/ucanalytics.com\/blogs\/marketing-analytics-retail-case-study-part-2\/\">Problem Definition<\/a><br \/>\nPart 3:\u00a0<a style=\"color: #ff9d73;\" href=\"http:\/\/ucanalytics.com\/blogs\/exploratory-data-analysis-retail-case-study-part-3\/\">EDA<\/a><br \/>\nPart 4:\u00a0<a style=\"color: #ff9d73;\" href=\"http:\/\/ucanalytics.com\/blogs\/association-analysis-retail-case-study-part-4\/\">Association Analysis<\/a><\/p>\n<p>In this article, we will discuss a type of decision tree called classification and regression tree (CART) to\u00a0develop a quick &amp; dirty model for the same case study example. But before that let us explore the essence of..<\/p>\n<h2><span style=\"color: #3366ff;\">Decision Trees<\/span><\/h2>\n<p>Let&#8217;s accept, we all do this before we pick a slice of pizza from the box: we quickly analyze the size of the piece, and proportions of toppings. In this\u00a0quick optimization, you mostly look for the biggest slice with the maximum amount of your favorite toppings (and possibly avoid your least favorite ones). Hence, I would rather not call\u00a0this little boy, shown in the picture, greedy. He is just trying to cut his birthday cake to maximize his preferred taste. \u00a0The cake has his favorite topping i.e red cherries, and not so favorite green apples in equal proportions (50-50). He needs to make a clean cut with just two strokes of the knife otherwise, the guests at his party won&#8217;t appreciate his messy use of the knife. With a complete deftness and using\u00a0the built-in decision tree in his brain, this boy cuts the perfect piece to savor his taste. Let us have a look at his artistry:<\/p>\n<div id=\"attachment_3629\" style=\"width: 520px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg\"><img aria-describedby=\"caption-attachment-3629\" data-attachment-id=\"3629\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/decision-tree-cake\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg?fit=759%2C630&amp;ssl=1\" data-orig-size=\"759,630\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Decision Tree Cake\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg?fit=300%2C249&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg?fit=640%2C531&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-3629\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg?resize=510%2C423\" alt=\"Decision Tree Cake - CART\" width=\"510\" height=\"423\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg?w=759&amp;ssl=1 759w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg?resize=250%2C207&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-Cake.jpg?resize=300%2C249&amp;ssl=1 300w\" sizes=\"(max-width: 510px) 100vw, 510px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-3629\" class=\"wp-caption-text\">Decision Tree Cake &#8211; The CART Algorithm<\/p><\/div>\n<p>He started with equal proportions of red and green (50%-50%). Remember, he wanted the most number of reds and least number of greens on his piece. His slice ,\u00a0a quarter of the cake, has 71% reds and 29% greens. Not bad! This is precisely how decision tree algorithms operate. Like the above problem, the CART algorithm tries to cut\/split the root node (the full cake) into just two pieces (no more). However, there are other decision tree algorithms we will discuss in the next article, capable of splitting the root node into many more pieces.<\/p>\n<p>I must point out that though we are using discrete data (such as red cherries and green apples) for the decision tree in this article, CART is equally capable of splitting continuous data such as age, distance etc.\u00a0Let us explore more about CART decision tree algorithm.<\/p>\n<h2><span style=\"color: #3366ff;\">Classification and\u00a0Regression Tree (CART)<\/span><\/h2>\n<p>I find algorithms extremely fascinating be it Google&#8217;s PageRank algorithm, Alan Turing&#8217;s cryptography algorithms, or several machine-learning algorithms. To me, algorithms are a mirror of structured thinking expressed through logic. For instance, the CART algorithm is an extension of the process that happened inside the brain of the little boy while splitting his birthday cake. He was trying to cut\u00a0the largest piece for himself with maximum cherries and least green apples. In this problem he had two objectives:<\/p>\n<ol>\n<li>Cut the largest piece with a clean cut<\/li>\n<li>Maximize the number of cherries on this piece while keeping green apples at lowest<\/li>\n<\/ol>\n<p>The CART decision tree algorithm is an effort to abide with the above two objectives. The following equation is a representation of a combination of the two objectives.\u00a0Don&#8217;t get intimidated by this equation, it is actually quite simple; you will realize it after we will have \u00a0solved an example in the next segment.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Ctextup%7BGoodness+of+Split%7D%3D2P_%7BL%7DP_%7BR%7D%5Ctimes+%5Csum_%7Bk%3D0%2C1%7D%5Cleft+%7C+P%28k%7C%5Ctextup%7BL%7D%29-P%28k%7C%5Ctextup%7BR%7D%29+%5Cright+%7C+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"&#92;textup{Goodness of Split}=2P_{L}P_{R}&#92;times &#92;sum_{k=0,1}&#92;left | P(k|&#92;textup{L})-P(k|&#92;textup{R}) &#92;right | \" class=\"latex\" \/><\/pre>\n<p>The first term here \u00a0i.e.\u00a0<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=2P_%7BL%7DP_%7BR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"2P_{L}P_{R} \" class=\"latex\" \/>\u00a0controls the first objective to cut the largest piece.\u00a0Let me call\u00a0this first\u00a0term &#8216;\u03a8(Large Piece)&#8217; \u00a0because it will remind us of the purpose behind the mathematical equation.<\/p>\n<p>Where as, the second term (<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Csum_%7Bk%3D0%2C1%7D%5Cleft+%7C+P%28k%7C%5Ctextup%7BL%7D%29-P%28k%7C%5Ctextup%7BR%7D%29+%5Cright+%7C+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"&#92;sum_{k=0,1}&#92;left | P(k|&#92;textup{L})-P(k|&#92;textup{R}) &#92;right | \" class=\"latex\" \/>)\u00a0controls the second objective. Again like the last equation, let me call\u00a0this second term &#8216;\u03a8(Pick Cherries)&#8217;.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Ctherefore+%5Ctextup%7BGoodness+of+Split%7D%3D%5CPsi+%28%5Ctextup%7BLarge+Piece%7D%29%5Ctimes+%5CPsi+%28%5Ctextup%7BPick+Cherries%7D%29+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"&#92;therefore &#92;textup{Goodness of Split}=&#92;Psi (&#92;textup{Large Piece})&#92;times &#92;Psi (&#92;textup{Pick Cherries}) \" class=\"latex\" \/><\/pre>\n<p>For our example, k=0,1 in above equation\u00a0are 0=green apples &amp; 1=red cherries. Remember, for our case study with\u00a0marketing campaigns, k=0,1 will become responded (r) and not-responded (nr) customers. Similarly, for our banking case study &amp; credit scoring articles (<a href=\"http:\/\/ucanalytics.com\/blogs\/tag\/credit-scorecard-development\/\">link<\/a>) they will become loan defaulters &amp; non-defaulters. However, the philosophy of decision tree and the CART will remain the same for all these examples and much more practical classification problems.<\/p>\n<p>Let me define some important terminologies for the CART decision tree algorithm before explaining the components of the above equation for the goodness of split.<\/p>\n<div id=\"attachment_3732\" style=\"width: 527px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg\"><img aria-describedby=\"caption-attachment-3732\" data-attachment-id=\"3732\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/dtree-cart-terminology\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg?fit=596%2C401&amp;ssl=1\" data-orig-size=\"596,401\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"The CART Decision Tree Terminology\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;The CART Decision Tree Terminology&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg?fit=300%2C201&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg?fit=596%2C401&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-3732\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg?resize=517%2C348\" alt=\"The CART Decision Tree Terminology\" width=\"517\" height=\"348\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg?w=596&amp;ssl=1 596w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg?resize=250%2C168&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/DTree-CART-terminology.jpg?resize=300%2C201&amp;ssl=1 300w\" sizes=\"(max-width: 517px) 100vw, 517px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-3732\" class=\"wp-caption-text\">The CART Decision Tree Terminologies<\/p><\/div>\n<p>The following is the definition of the components in the above equation for the goodness of split.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=L%3A+%5Ctextup%7BLeft+child+node+for+the+root+node%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"L: &#92;textup{Left child node for the root node} \" class=\"latex\" \/>\r\n<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=R%3A+%5Ctextup%7BRight+child+node+for+the+root+node%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"R: &#92;textup{Right child node for the root node} \" class=\"latex\" \/>\r\n\r\n<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=P_%7BL%7D%3D+%5Cfrac%7B%5Ctextup%7BNumber+of+records+in+left+child+node%7D%7D%7B%5Ctextup%7BTotal+number+of+records%7D%7D++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"P_{L}= &#92;frac{&#92;textup{Number of records in left child node}}{&#92;textup{Total number of records}}  \" class=\"latex\" \/>\r\n\r\n<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=P_%7BR%7D%3D+%5Cfrac%7B%5Ctextup%7BNumber+of+records+in+right+child+node%7D%7D%7B%5Ctextup%7BTotal+number+of+records%7D%7D++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"P_{R}= &#92;frac{&#92;textup{Number of records in right child node}}{&#92;textup{Total number of records}}  \" class=\"latex\" \/>\r\n\r\n<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=P%28k%7C%5Ctextup%7BL%7D%29%3D%5Cfrac%7B%5Ctextup%7BNumber+of+class+k+records+in+left+child+node%7D%7D%7B%5Ctextup%7BNumber+of+records+in+left+child+node%7D%7D++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"P(k|&#92;textup{L})=&#92;frac{&#92;textup{Number of class k records in left child node}}{&#92;textup{Number of records in left child node}}  \" class=\"latex\" \/>\r\n\r\n<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=P%28k%7C%5Ctextup%7BR%7D%29%3D%5Cfrac%7B%5Ctextup%7BNumber+of+class+k+records+in+right+child+node%7D%7D%7B%5Ctextup%7BNumber+of+records+in+right+child+node%7D%7D++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"P(k|&#92;textup{R})=&#92;frac{&#92;textup{Number of class k records in right child node}}{&#92;textup{Number of records in right child node}}  \" class=\"latex\" \/>\r\n<\/pre>\n<p>I hope you have realized, the largest value of the product of \u03a8(Large Piece) and\u00a0&#8216;\u03a8(Pick Cherries) called the goodness of split will generate the best decision tree for our purpose. Things will get much clearer when we will solve an example for our retail case study example using CART decision tree.<\/p>\n<h2><span style=\"color: #3366ff;\">Retail Case &#8211; Decision Tree (CART)<\/span><\/h2>\n<p>Back to our retail case study example, where you are\u00a0the Chief Analytics Officer &amp; Business Strategy Head at an online shopping store called DresSMart Inc. that specializes in apparel and clothing. In this case\u00a0example,\u00a0your effort is to improve a future\u00a0campaign&#8217;s performance. To meet this objective, you are analyzing data from an earlier campaign where\u00a0direct mailing product catalogs were sent to hundred thousand customers from the complete customer base of over a couple of million customers. \u00a0The overall response rate for this campaign was 4.2%.<\/p>\n<p>You have divided the total hundred thousand solicited customers into three categories based on their past 3 months activities before the campaign. The following is the distribution of the same. Here, the success rate is the percentage of customers responded (r) to the campaigns out of total solicited customers.<\/p>\n<table style=\"width: 561px;\" border=\"2\" width=\"561\">\n<tbody>\n<tr style=\"background-color: #1a8fe4; border: 1px solid #000000;\">\n<td rowspan=\"2\" width=\"191\"><span style=\"color: #ffffff;\"><strong>Activity in the Last\u00a0Quarter<\/strong><\/span><\/td>\n<td rowspan=\"2\" width=\"100\"><span style=\"color: #ffffff;\"><strong>Number of Solicited Customers<\/strong><\/span><\/td>\n<td style=\"text-align: center;\" colspan=\"2\" width=\"171\"><span style=\"color: #ffffff;\"><strong>Campaign Results<\/strong><\/span><\/td>\n<td rowspan=\"2\" width=\"99\"><span style=\"color: #ffffff;\"><strong>Success\u00a0Rate<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"background-color: #1a8fe4; border: 1px solid #000000;\">\n<td><span style=\"color: #ffffff;\"><strong>Responded (<em>r<\/em>)\u00a0<\/strong><\/span><\/td>\n<td><span style=\"color: #ffffff;\"><strong>Not\u00a0Responded (<em>nr<\/em>)<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td style=\"background-color: #fdc9a4;\"><strong>low<\/strong><\/td>\n<td>40000<\/td>\n<td>720<\/td>\n<td>39280<\/td>\n<td>1.8%<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td style=\"background-color: #fdc9a4;\"><strong>medium<\/strong><\/td>\n<td>30000<\/td>\n<td>1380<\/td>\n<td>28620<\/td>\n<td>4.6%<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td style=\"background-color: #fdc9a4;\"><strong>high<\/strong><\/td>\n<td>30000<\/td>\n<td>2100<\/td>\n<td>27900<\/td>\n<td>7.0%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As you know, CART decision tree algorithm splits the root node into just two child nodes. Hence for this data, CART can form three combinations of binary trees\u00a0as shown in the table below. We need to figure out \u00a0which is the best split among these 3 combinations. The results for the same are shown in the table below.<\/p>\n<table style=\"width: 650px; height: 282px;\" border=\"2\" width=\"650\">\n<tbody>\n<tr style=\"background-color: #1a8fe4; border: 1px solid #000000;\">\n<td rowspan=\"2\" width=\"80\"><strong><span style=\"color: #ffffff;\">Left Node<\/span><\/strong><\/td>\n<td rowspan=\"2\" width=\"80\"><strong><span style=\"color: #ffffff;\">Right Node<\/span><\/strong><\/td>\n<td rowspan=\"2\" width=\"60\"><strong><span style=\"color: #ffffff;\">P<sub>L<\/sub><\/span><\/strong><\/td>\n<td rowspan=\"2\" width=\"60\"><strong><span style=\"color: #ffffff;\">P<sub>R<\/sub><\/span><\/strong><\/td>\n<td rowspan=\"2\" width=\"90\"><strong><span style=\"color: #ffffff;\">P(k|L) \u00a0= a<\/span><\/strong><\/td>\n<td rowspan=\"2\" width=\"90\"><strong><span style=\"color: #ffffff;\">P(k|R) \u00a0= b<\/span><\/strong><\/td>\n<td width=\"60\"><span style=\"color: #ffffff;\"><strong>\u03a8(Large Piece)<\/strong><\/span><\/td>\n<td width=\"60\"><span style=\"color: #ffffff;\"><strong>\u03a8(Pick Cherries)<\/strong><\/span><\/td>\n<td rowspan=\"2\" width=\"76\"><strong><span style=\"color: #ffffff;\">Goodness of Split<\/span><\/strong><\/td>\n<\/tr>\n<tr style=\"background-color: #1a8fe4; border: 1px solid #000000;\">\n<td><strong><span style=\"color: #ffffff;\">2P<sub>L<\/sub>P<sub>R<\/sub><\/span><\/strong><\/td>\n<td><span style=\"color: #ffffff;\"><strong>\u03a3(a-b)<br \/>\n<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td style=\"background-color: #fdc9a4;\" rowspan=\"2\"><strong>Low<\/strong><\/td>\n<td style=\"background-color: #fdc9a4;\" rowspan=\"2\"><strong>Medium+High<\/strong><\/td>\n<td rowspan=\"2\">0.4<\/td>\n<td rowspan=\"2\">0.6<\/td>\n<td>r: 0.018<\/td>\n<td>r: 0.058<\/td>\n<td rowspan=\"2\">0.48<\/td>\n<td rowspan=\"2\">0.080<\/td>\n<td rowspan=\"2\"><span style=\"font-size: 14pt;\"><strong>0.0384<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td>nr: 0.982<\/td>\n<td>nr: 0.942<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td style=\"background-color: #fdc9a4;\" rowspan=\"2\"><strong>Low+Medium<\/strong><\/td>\n<td style=\"background-color: #fdc9a4;\" rowspan=\"2\"><strong>High<\/strong><\/td>\n<td rowspan=\"2\">0.7<\/td>\n<td rowspan=\"2\">0.3<\/td>\n<td>r: 0.030<\/td>\n<td>r: 0.070<\/td>\n<td rowspan=\"2\">0.42<\/td>\n<td rowspan=\"2\">0.080<\/td>\n<td rowspan=\"2\"><span style=\"font-size: 14pt;\"><strong>0.0336<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td>nr: 0.970<\/td>\n<td>nr: 0.930<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td style=\"background-color: #fdc9a4;\" rowspan=\"2\"><strong>Low+high<\/strong><\/td>\n<td style=\"background-color: #fdc9a4;\" rowspan=\"2\"><strong>Medium<\/strong><\/td>\n<td rowspan=\"2\">0.7<\/td>\n<td rowspan=\"2\">0.3<\/td>\n<td>r: 0.040<\/td>\n<td>r: 0.046<\/td>\n<td rowspan=\"2\">0.42<\/td>\n<td rowspan=\"2\">0.011<\/td>\n<td rowspan=\"2\"><span style=\"font-size: 14pt;\"><strong>0.0048<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #000000;\">\n<td>nr: 0.960<\/td>\n<td>nr: 0.954<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Let me help you out with the calculation of each column for the above tree. We will use the first row (i.e left node: Low and right node: Medium+High) for the following calculations and then you could do the rest of the calculations yourself. To start with we have calculated P<sub>L<\/sub> and P<sub>R\u00a0<\/sub>in the following way:<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=P_%7BL%7D%3D%5Cfrac%7B%5Ctextup%7B%5C%23+customers+in+Low%7D%7D%7B%5Ctextup%7BAll+the+customers+%7D%7D%3D%5Cfrac%7B40000%7D%7B100000%7D%3D0.4++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"P_{L}=&#92;frac{&#92;textup{&#92;# customers in Low}}{&#92;textup{All the customers }}=&#92;frac{40000}{100000}=0.4  \" class=\"latex\" \/><\/pre>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=P_%7BR%7D%3D%5Cfrac%7B%5Ctextup%7B%5C%23+customers+in+Medium+%2B+High%7D%7D%7B%5Ctextup%7BAll+the+customers+%7D%7D%3D%5Cfrac%7B60000%7D%7B100000%7D%3D0.6++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"P_{R}=&#92;frac{&#92;textup{&#92;# customers in Medium + High}}{&#92;textup{All the customers }}=&#92;frac{60000}{100000}=0.6  \" class=\"latex\" \/><\/pre>\n<p>Now the calculation for\u00a0\u03a8(Large Piece) is simple as shown below:<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5CPsi+%28%5Ctextup%7BLarge+Piece%7D%29%3D2P_%7BL%7DP_%7BR%7D%3D2%5Ctimes0.4%5Ctimes+0.6%3D0.48++&#038;bg=ffffff&#038;fg=000&#038;s=1&#038;c=20201002\" alt=\"&#92;Psi (&#92;textup{Large Piece})=2P_{L}P_{R}=2&#92;times0.4&#92;times 0.6=0.48  \" class=\"latex\" \/><\/pre>\n<p>Now, let&#8217;s come to the second part of the equation that is\u00a0\u03a8(Pick Cherries). Remember, r represents responded and nr\u00a0<span style=\"background-color: #f5f6f5;\">represents<\/span>\u00a0not-responded\u00a0customers for our campaign&#8217;s example.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Ctextup%7Br%3A+%7DP%28k%7CL%29%3D%5Cfrac%7B%5Ctextup%7B%5C%23+customers+responded+in+Low%7D%7D%7B%5Ctextup%7BTotal+number+of+customers+in+Low%7D%7D%3D%5Cfrac%7B720%7D%7B40000%7D%3D0.018++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"&#92;textup{r: }P(k|L)=&#92;frac{&#92;textup{&#92;# customers responded in Low}}{&#92;textup{Total number of customers in Low}}=&#92;frac{720}{40000}=0.018  \" class=\"latex\" \/><\/pre>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Ctextup%7Bnr%3A+%7D+P%28k%7CL%29%3D%5Cfrac%7B%5Ctextup%7B%5C%23+customers+not+responded+in+Low%7D%7D%7B%5Ctextup%7BTotal+number+of+customers+in+Low%7D%7D%3D%5Cfrac%7B39280%7D%7B40000%7D%3D0.982++&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"&#92;textup{nr: } P(k|L)=&#92;frac{&#92;textup{&#92;# customers not responded in Low}}{&#92;textup{Total number of customers in Low}}=&#92;frac{39280}{40000}=0.982  \" class=\"latex\" \/><\/pre>\n<p>You may want to calculate the other two terms (i.e r: P(k|R), and nr: P(k|R)) yourself before plugging them in the following equation to get the value for \u03a8(Pick Cherries).<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5CPsi%28%5Ctextup%7BPick+Cherries%7D%29%3D%5Cleft+%7CP%28r%7CL%29-P%28r%7CR%29+%5Cright+%7C%2B%5Cleft+%7C+P%28nr%7CL%29-P%28nr%7CR%29+%5Cright%7C+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"&#92;Psi(&#92;textup{Pick Cherries})=&#92;left |P(r|L)-P(r|R) &#92;right |+&#92;left | P(nr|L)-P(nr|R) &#92;right| \" class=\"latex\" \/>\r\n\r\n<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Ctherefore+%5CPsi%28%5Ctextup%7BPick+Cherries%7D%29%3D%7C0.018-0.058%7C%2B%7C0.982-0.942%7C%3D0.080+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"&#92;therefore &#92;Psi(&#92;textup{Pick Cherries})=|0.018-0.058|+|0.982-0.942|=0.080 \" class=\"latex\" \/><\/pre>\n<p>This leaves us with one last calculation for the last column i.e.\u00a0\u00a0goodness of split which is:<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Ctextup%7BGoodness+of+split%7D%3D%5CPsi%28%5Ctextup%7BLarge+Piece%7D%29%5Ctimes+%5CPsi+%28%5Ctextup%7BPick+Cherries%7D%29%3D0.48%5Ctimes+0.080+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"&#92;textup{Goodness of split}=&#92;Psi(&#92;textup{Large Piece})&#92;times &#92;Psi (&#92;textup{Pick Cherries})=0.48&#92;times 0.080 \" class=\"latex\" \/>\r\n\r\n<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Ctherefore+%5Ctextup%7BGoodness+of+split%7D+%3D0.0384+&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002\" alt=\"&#92;therefore &#92;textup{Goodness of split} =0.0384 \" class=\"latex\" \/><\/pre>\n<p>The final task now is to find the maximum value for goodness of split in the last column. This will produce the following decision tree through the CART algorithm with\u00a0\u00a0 Low on the left node, and Medium+High on the\u00a0right node.<\/p>\n<div id=\"attachment_3744\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg\"><img aria-describedby=\"caption-attachment-3744\" data-attachment-id=\"3744\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/decision-tree-the-cart\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg?fit=650%2C398&amp;ssl=1\" data-orig-size=\"650,398\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Decision Tree The CART\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Decision Tree The CART&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg?fit=300%2C183&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg?fit=640%2C392&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3744\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg?resize=640%2C392\" alt=\"Decision Tree The CART\" width=\"640\" height=\"392\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg?w=650&amp;ssl=1 650w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg?resize=250%2C153&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/Decision-Tree-The-CART.jpg?resize=300%2C183&amp;ssl=1 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-3744\" class=\"wp-caption-text\">Decision Tree &#8211; The CART Algorithm Final Result<\/p><\/div>\n<p>This is an important business insight as well that people with higher activity tend to respond better to campaigns. I agree it was clear from the first\u00a0table at the top as well, but we have learned the science of creating decision tree using the CART algorithm in the process. This is extremely useful when you are dealing with a large dataset and want to create decision tree through recursive partitioning.<\/p>\n<h4><span style=\"color: #3366ff;\">Sign-off Note<\/span><\/h4>\n<p>OK, next time while choosing that pizza slice,\u00a0remember the evolutionary decision tree that helps you maximize your chances for the best slice. Once in a while, you may want to leave that best slice for someone else &#8211; I bet you will feel equally good!<\/p>\n<p>In the next article,\u00a0we will extend this concept of binary child node decision tree through the CART algorithm to more than two nodes decision tree through other algorithms. See you soon!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is a continuation of the\u00a0retail case study example we have been working on for the last few weeks. You can find the previous 4 parts of the case at the following links: Part 1:\u00a0Introduction Part 2:\u00a0Problem Definition Part 3:\u00a0EDA Part 4:\u00a0Association Analysis In this article, we will discuss a type of decision tree<\/p>\n<p><a class=\"excerpt-more blog-excerpt\" href=\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3584,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1,59],"tags":[7,42,6,72,10],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Decision Tree (CART) - Retail Case Study Example<\/title>\n<meta name=\"description\" content=\"Case study example for an online retail store: explore the power of CART Decision Tree in marketing analytics for customer segmentation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Decision Tree (CART) - Retail Case Study Example\" \/>\n<meta property=\"og:description\" content=\"Case study example for an online retail store: explore the power of CART Decision Tree in marketing analytics for customer segmentation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/\" \/>\n<meta property=\"og:site_name\" content=\"YOU CANalytics |\" \/>\n<meta property=\"article:author\" content=\"roopam\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-27T05:49:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-10-13T08:58:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&#038;ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"756\" \/>\n\t<meta property=\"og:image:height\" content=\"1008\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roopam Upadhyay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#organization\",\"name\":\"YOU CANalytics\",\"url\":\"https:\/\/ucanalytics.com\/blogs\/\",\"sameAs\":[],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120\",\"contentUrl\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120\",\"width\":607,\"height\":120,\"caption\":\"YOU CANalytics\"},\"image\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#website\",\"url\":\"https:\/\/ucanalytics.com\/blogs\/\",\"name\":\"YOU CANalytics |\",\"description\":\"Explore the Power of Data Science\",\"publisher\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ucanalytics.com\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1\",\"width\":756,\"height\":1008,\"caption\":\"Greedy Decision Tree \\u2013 by Roopam\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#webpage\",\"url\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/\",\"name\":\"Decision Tree (CART) - Retail Case Study Example\",\"isPartOf\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#primaryimage\"},\"datePublished\":\"2014-07-27T05:49:09+00:00\",\"dateModified\":\"2016-10-13T08:58:51+00:00\",\"description\":\"Case study example for an online retail store: explore the power of CART Decision Tree in marketing analytics for customer segmentation.\",\"breadcrumb\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ucanalytics.com\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Decision Tree (CART) &#8211; Retail Case Study Example (Part 5)\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#webpage\"},\"author\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6\"},\"headline\":\"Decision Tree (CART) &#8211; Retail Case Study Example (Part 5)\",\"datePublished\":\"2014-07-27T05:49:09+00:00\",\"dateModified\":\"2016-10-13T08:58:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#webpage\"},\"wordCount\":1463,\"commentCount\":23,\"publisher\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#organization\"},\"image\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1\",\"keywords\":[\"Business Analytics\",\"Marketing Analytics\",\"Predictive Analytics\",\"Retail Analytics\",\"Roopam Upadhyay\"],\"articleSection\":[\"Marketing Analytics\",\"Retail Case Study Example\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6\",\"name\":\"Roopam Upadhyay\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g\",\"caption\":\"Roopam Upadhyay\"},\"description\":\"This blog contains my personal views and thoughts on predictive Analytics and big data. - Roopam Upadhyay\",\"sameAs\":[\"roopam\"],\"url\":\"https:\/\/ucanalytics.com\/blogs\/author\/roopam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Decision Tree (CART) - Retail Case Study Example","description":"Case study example for an online retail store: explore the power of CART Decision Tree in marketing analytics for customer segmentation.","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:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/","og_locale":"en_US","og_type":"article","og_title":"Decision Tree (CART) - Retail Case Study Example","og_description":"Case study example for an online retail store: explore the power of CART Decision Tree in marketing analytics for customer segmentation.","og_url":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/","og_site_name":"YOU CANalytics |","article_author":"roopam","article_published_time":"2014-07-27T05:49:09+00:00","article_modified_time":"2016-10-13T08:58:51+00:00","og_image":[{"width":756,"height":1008,"url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1","type":"image\/jpeg"}],"twitter_misc":{"Written by":"Roopam Upadhyay","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/ucanalytics.com\/blogs\/#organization","name":"YOU CANalytics","url":"https:\/\/ucanalytics.com\/blogs\/","sameAs":[],"logo":{"@type":"ImageObject","@id":"https:\/\/ucanalytics.com\/blogs\/#logo","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120","contentUrl":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120","width":607,"height":120,"caption":"YOU CANalytics"},"image":{"@id":"https:\/\/ucanalytics.com\/blogs\/#logo"}},{"@type":"WebSite","@id":"https:\/\/ucanalytics.com\/blogs\/#website","url":"https:\/\/ucanalytics.com\/blogs\/","name":"YOU CANalytics |","description":"Explore the Power of Data Science","publisher":{"@id":"https:\/\/ucanalytics.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ucanalytics.com\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#primaryimage","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1","width":756,"height":1008,"caption":"Greedy Decision Tree \u2013 by Roopam"},{"@type":"WebPage","@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#webpage","url":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/","name":"Decision Tree (CART) - Retail Case Study Example","isPartOf":{"@id":"https:\/\/ucanalytics.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#primaryimage"},"datePublished":"2014-07-27T05:49:09+00:00","dateModified":"2016-10-13T08:58:51+00:00","description":"Case study example for an online retail store: explore the power of CART Decision Tree in marketing analytics for customer segmentation.","breadcrumb":{"@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ucanalytics.com\/blogs\/"},{"@type":"ListItem","position":2,"name":"Decision Tree (CART) &#8211; Retail Case Study Example (Part 5)"}]},{"@type":"Article","@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#article","isPartOf":{"@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#webpage"},"author":{"@id":"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6"},"headline":"Decision Tree (CART) &#8211; Retail Case Study Example (Part 5)","datePublished":"2014-07-27T05:49:09+00:00","dateModified":"2016-10-13T08:58:51+00:00","mainEntityOfPage":{"@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#webpage"},"wordCount":1463,"commentCount":23,"publisher":{"@id":"https:\/\/ucanalytics.com\/blogs\/#organization"},"image":{"@id":"https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1","keywords":["Business Analytics","Marketing Analytics","Predictive Analytics","Retail Analytics","Roopam Upadhyay"],"articleSection":["Marketing Analytics","Retail Case Study Example"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ucanalytics.com\/blogs\/decision-tree-cart-retail-case-example-part-5\/#respond"]}]},{"@type":"Person","@id":"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6","name":"Roopam Upadhyay","image":{"@type":"ImageObject","@id":"https:\/\/ucanalytics.com\/blogs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g","caption":"Roopam Upadhyay"},"description":"This blog contains my personal views and thoughts on predictive Analytics and big data. - Roopam Upadhyay","sameAs":["roopam"],"url":"https:\/\/ucanalytics.com\/blogs\/author\/roopam\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/photo-1.jpg?fit=756%2C1008&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3L0jT-VN","jetpack-related-posts":[{"id":3973,"url":"https:\/\/ucanalytics.com\/blogs\/model-selection-retail-case-study-example-part-7\/","url_meta":{"origin":3583,"position":0},"title":"Model Selection &#8211; Retail Case Study Example (Part 7)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"Model Selection This is a continuation of our retail case study example for campaign and marketing analytics. In the previous two parts, we discussed a couple of decision tree algorithms (CART and C4.5)\u00a0for classification. Recall a previous case study example on\u00a0banking and risk management where we discussed logistic regression\u00a0which is\u2026","rel":"","context":"In &quot;Marketing Analytics&quot;","block_context":{"text":"Marketing Analytics","link":"https:\/\/ucanalytics.com\/blogs\/category\/marketing-analytics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/09\/photo.jpg?fit=1200%2C1029&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/09\/photo.jpg?fit=1200%2C1029&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/09\/photo.jpg?fit=1200%2C1029&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/09\/photo.jpg?fit=1200%2C1029&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/09\/photo.jpg?fit=1200%2C1029&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3129,"url":"https:\/\/ucanalytics.com\/blogs\/marketing-analytics-retail-case-study-part-1\/","url_meta":{"origin":3583,"position":1},"title":"Marketing Analytics &#8211; Retail Case Study Example (Part 1)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"Today we are going to start a new case study example on YOU CANalytics. In this case study example, we will examine different facets of marketing analytics and customer relationship management (CRM). We will use the example of online retail to explore more about marketing analytics - an area of\u2026","rel":"","context":"In &quot;Marketing Analytics&quot;","block_context":{"text":"Marketing Analytics","link":"https:\/\/ucanalytics.com\/blogs\/category\/marketing-analytics\/"},"img":{"alt_text":"Marketing Analytics Modeling","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/06\/Marketing-Analytics-Modeling-Blog.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/06\/Marketing-Analytics-Modeling-Blog.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/06\/Marketing-Analytics-Modeling-Blog.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/06\/Marketing-Analytics-Modeling-Blog.jpg?resize=700%2C400 2x"},"classes":[]},{"id":3831,"url":"https:\/\/ucanalytics.com\/blogs\/decision-tree-entropy-retail-case-part-6\/","url_meta":{"origin":3583,"position":2},"title":"Decision Tree &#8211; Entropy &#8211; Retail Case Study Example (Part 6)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"This article is a continuation of the retail case study example we have been working on for the last few weeks. You can find the previous parts of the case study example at the following links: Part 1:\u00a0Introduction Part 2:\u00a0Problem Definition Part 3:\u00a0EDA Part 4:\u00a0Association Analysis Part 5: Decision Tree\u2026","rel":"","context":"In &quot;Marketing Analytics&quot;","block_context":{"text":"Marketing Analytics","link":"https:\/\/ucanalytics.com\/blogs\/category\/marketing-analytics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/08\/photo-2.jpg?fit=852%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/08\/photo-2.jpg?fit=852%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/08\/photo-2.jpg?fit=852%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/08\/photo-2.jpg?fit=852%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4357,"url":"https:\/\/ucanalytics.com\/blogs\/next-best-action-retail-case-study-example-part-11\/","url_meta":{"origin":3583,"position":3},"title":"Next Best Action &#8211; Retail Case Study Example (Epilogue)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"This article is the epilogue to our case study example about campaign and marketing analytics for an online retail company. You could read the previous parts at Problem definition: \u00a0Part 1\u00a0&\u00a0Part 2 Description: Part 3 Association: Part 4 Classification: Part 5, Part 6,\u00a0Part 7,\u00a0Part 8 Estimation: Part 9, Part 10\u2026","rel":"","context":"In &quot;Marketing Analytics&quot;","block_context":{"text":"Marketing Analytics","link":"https:\/\/ucanalytics.com\/blogs\/category\/marketing-analytics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/11\/Free-Will.jpg?fit=315%2C448&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3195,"url":"https:\/\/ucanalytics.com\/blogs\/marketing-analytics-retail-case-study-example-part-2\/","url_meta":{"origin":3583,"position":4},"title":"Marketing Analytics &#8211; Retail Case Study Example (Part 2)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"Last week we started a case study from the online retail industry to learn more about marketing analytics (Read Part 1). Before we continue with the same case, let me share a few factors that enhance the quality of analysis for marketing or customer analytics. The obvious factors, of course,\u2026","rel":"","context":"In &quot;Marketing Analytics&quot;","block_context":{"text":"Marketing Analytics","link":"https:\/\/ucanalytics.com\/blogs\/category\/marketing-analytics\/"},"img":{"alt_text":"Noir - by Roopam","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/02\/photo.jpg?fit=713%2C1024&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/02\/photo.jpg?fit=713%2C1024&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/02\/photo.jpg?fit=713%2C1024&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/02\/photo.jpg?fit=713%2C1024&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3318,"url":"https:\/\/ucanalytics.com\/blogs\/exploratory-data-analysis-retail-case-study-example-part-3\/","url_meta":{"origin":3583,"position":5},"title":"Exploratory Data Analysis (EDA) &#8211; Retail Case Study Example (Part 3)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"For the last couple of weeks we have been\u00a0working on a marketing analytics case study example (read Part 1 and Part 2). In the last part (Part 2) we defined a couple of advanced analytics objectives based on the business problem at an online retail\u00a0company called DresSmart Inc. In this\u2026","rel":"","context":"In &quot;Marketing Analytics&quot;","block_context":{"text":"Marketing Analytics","link":"https:\/\/ucanalytics.com\/blogs\/category\/marketing-analytics\/"},"img":{"alt_text":"penalty shootout","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/penalty-shootout.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/penalty-shootout.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2014\/07\/penalty-shootout.jpg?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/posts\/3583"}],"collection":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/comments?post=3583"}],"version-history":[{"count":0,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/posts\/3583\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/media\/3584"}],"wp:attachment":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/media?parent=3583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/categories?post=3583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/tags?post=3583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}