<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using decision tree to consolidate levels of a class variable in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373949#M5553</link>
    <description>&lt;P&gt;Thanks Wendy&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2017 13:02:00 GMT</pubDate>
    <dc:creator>frupaul</dc:creator>
    <dc:date>2017-07-07T13:02:00Z</dc:date>
    <item>
      <title>Using decision tree to consolidate levels of a class variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373101#M5542</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have successfully used a decision tree to consolidate(collapse) the levels of a categorical variable, Region. The process flow is as shown in the first attachment. I would like this new variable with collapsed levels to automatically serve as input to the proceeding node, say a regression node. I know I can do this manually using the replacement editor but is it possible to have SAS create a new variable with the new collapsed levels?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second, my decision tree (image two) show me the leaves but the leaves dont show all the levels of the categorical variable. What could I do to actually see all the levels which make up the leaves?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14031i6E4206AA0B2A05FA/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="one.JPG" title="one.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14032i6D723802F5E58867/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="two.JPG" title="two.JPG" /&gt;</description>
      <pubDate>Tue, 04 Jul 2017 22:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373101#M5542</guid>
      <dc:creator>frupaul</dc:creator>
      <dc:date>2017-07-04T22:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using decision tree to consolidate levels of a class variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373395#M5547</link>
      <description>&lt;P&gt;You should see a property called &lt;STRONG&gt;Leaf Role&lt;/STRONG&gt; in the Decision Tree node, and you can set that to be &lt;STRONG&gt;Input&lt;/STRONG&gt; to use this _NODE_ variable, which represents your collapsed levels, in subsequent nodes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can look at the Node Rules (under View&amp;gt;Model) or the score code (Scoring&amp;gt;SAS Code) in the Decision Tree results to see the full rules with all levels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;Wendy&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 18:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373395#M5547</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2017-07-05T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using decision tree to consolidate levels of a class variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373578#M5548</link>
      <description>&lt;P&gt;Thanks Wendy,&lt;/P&gt;&lt;P&gt;And this is not very related to the first questions. After consolidating levels of a&amp;nbsp;class variable&amp;nbsp;using a tree and setting the properties of the tree&amp;nbsp;to act as an input to a model, how can one bring in that new input (from tree consolidation)&amp;nbsp;alongside other inputs(which are not outputs of the tree consolidation) into a node like the regression node?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 10:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373578#M5548</guid>
      <dc:creator>frupaul</dc:creator>
      <dc:date>2017-07-06T10:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using decision tree to consolidate levels of a class variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373636#M5550</link>
      <description>&lt;P&gt;You just need to connect the Regression (or other modeling) node after the Decision Tree, and it will use all your original inputs plus the new leaf id (_NODE_) variable. &amp;nbsp;You can always use a Metadata node to change the roles of any of your variables mid-flow as well.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 13:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373636#M5550</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2017-07-06T13:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using decision tree to consolidate levels of a class variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373949#M5553</link>
      <description>&lt;P&gt;Thanks Wendy&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 13:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/373949#M5553</guid>
      <dc:creator>frupaul</dc:creator>
      <dc:date>2017-07-07T13:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using decision tree to consolidate levels of a class variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/374003#M5556</link>
      <description>&lt;P&gt;Hi Wendy,&lt;/P&gt;&lt;P&gt;This might be a big ask but say I had three variables (Post Code, Region, income_group) for which I wanted to consolidate their levels using a decision tree. An approach will be using three decision tree nodes for the three variables. However, is it possible to use a single decision tree node, and then maybe change certain properties to allow the tree node to produce three separate new variables for the collapsed levels of those three variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 15:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-decision-tree-to-consolidate-levels-of-a-class-variable/m-p/374003#M5556</guid>
      <dc:creator>frupaul</dc:creator>
      <dc:date>2017-07-07T15:34:17Z</dc:date>
    </item>
  </channel>
</rss>

