<?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: Clustering in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Clustering/m-p/394747#M6008</link>
    <description>&lt;P&gt;I'll try and respond to each of your questions below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I am wondering how SAS Miner deal with a combination of nominal and interval, and how trustworthy are the clusters/segments obtained.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The only way to bring categorical data into numerical algorithms is to code the values. &amp;nbsp;There is not a right way or wrong way to do that because there is not right distance between red and blue (for instance). &amp;nbsp; If I code red as 0 and blue as 1, they are 1 unit apart. &amp;nbsp; To see what SAS Enterprise Miner is doing, you only need to look at the help by opening SAS Enterprise Miner and clicking on Help --&amp;gt; Contents. &amp;nbsp;Then navigate in the panel on the left to&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Node Reference&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Explore&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cluster Node&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and then click on "Coding of the Class Variables in the Cluster Node" in the panel on the right where you will see the following (excerpted -- see application help for examples):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To incorporate the class variables into the analysis, the &lt;STRONG&gt;Cluster&lt;/STRONG&gt; node codes the class variables as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Binary&lt;/STRONG&gt; — one dummy variable is created. It contains a value of 0 or 1.&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Nominal&lt;/STRONG&gt; — one dummy variable is created per level that contains a value of 0 or 1.&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Ordinal&lt;/STRONG&gt; — one dummy variable is created for each ordinal input. The smallest ordered value is mapped to 1, the next smallest ordered value is mapped to 2, and so on.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please note that this is a common way to code categorical variables. &amp;nbsp;The coding does not impact how 'trustworthy' the segments are since there is no correct distance between red and blue (for example). &amp;nbsp;Clustering was designed for numerical data but like many such methods, it can be adapted for categorical data. &amp;nbsp;If you only have one categorical variable, it might be better to consider building a cluster solution of your numerical variables for each level of your categorical variable. &amp;nbsp; There is no right or wrong cluster solution -- just solutions that are more helpful or less helpful based on your analysis goals. &amp;nbsp; The decision about&amp;nbsp;the best approach is therefore a judgement call for the analyst. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I personally don't like to use categorical variables in clustering since the clusters don't tend to neatly resolve categories which can muddle interpretation. &amp;nbsp; Instead of having a clean break of red and blue into different clusters, you might end up with 80% red and 20% blue in one cluster and 20% red and 80% blue in another. &amp;nbsp; This does not mean that the solution isn't useful -- it just might be more difficult to interpret than two separate cluster solutions - one done for the blue observations and one done for the red observations. &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The colors of my clusters in Segment Plot Window and Segment Size Window are different&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The colors in the Segment Plot window correspond to ranges of values for the variable in question in each segment. &amp;nbsp;You can click on one of the small squares in the legend in order to see the proportion of that range of values which appears in each segment. &amp;nbsp; The colors in Segment Size window correspond to the segment itself, not the range of values for a variable for a particular segment. &amp;nbsp;As a result, there is no expectation that the colors should coincide. &amp;nbsp;The Segment Plot window is easier to understand if you click through the squares representing ranges of values so that you can see where those values are highlighted in the chart itself. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2018 20:08:34 GMT</pubDate>
    <dc:creator>DougWielenga</dc:creator>
    <dc:date>2018-02-26T20:08:34Z</dc:date>
    <item>
      <title>Clustering</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Clustering/m-p/394177#M5990</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a combination of cluster node+segment profile node on a customer dataset. I have 9 interval variables and one nominal.&lt;/P&gt;&lt;P&gt;I have two questions:1. I used to use Python and I was using Hot Encoder to transform my nominal variable(s) into dummy indicators, so that all my variables would be numeric and a k-means algo could be used. I am wondering how SAS Miner deal with a combination of nominal and interval, and how trustworthy are the clusters/segments obtained.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. My second question is more on the graphic side: when I check the Results from the Cluster Node, the colors of my clusters in Segment Plot Window and Segment Size Window are different. Which can be very confusing. It might be an easy change but I do not seem to sort this out myself.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nicolas&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 10:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Clustering/m-p/394177#M5990</guid>
      <dc:creator>NicolasC</dc:creator>
      <dc:date>2017-09-08T10:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Clustering</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Clustering/m-p/394747#M6008</link>
      <description>&lt;P&gt;I'll try and respond to each of your questions below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I am wondering how SAS Miner deal with a combination of nominal and interval, and how trustworthy are the clusters/segments obtained.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The only way to bring categorical data into numerical algorithms is to code the values. &amp;nbsp;There is not a right way or wrong way to do that because there is not right distance between red and blue (for instance). &amp;nbsp; If I code red as 0 and blue as 1, they are 1 unit apart. &amp;nbsp; To see what SAS Enterprise Miner is doing, you only need to look at the help by opening SAS Enterprise Miner and clicking on Help --&amp;gt; Contents. &amp;nbsp;Then navigate in the panel on the left to&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Node Reference&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Explore&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cluster Node&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and then click on "Coding of the Class Variables in the Cluster Node" in the panel on the right where you will see the following (excerpted -- see application help for examples):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To incorporate the class variables into the analysis, the &lt;STRONG&gt;Cluster&lt;/STRONG&gt; node codes the class variables as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Binary&lt;/STRONG&gt; — one dummy variable is created. It contains a value of 0 or 1.&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Nominal&lt;/STRONG&gt; — one dummy variable is created per level that contains a value of 0 or 1.&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Ordinal&lt;/STRONG&gt; — one dummy variable is created for each ordinal input. The smallest ordered value is mapped to 1, the next smallest ordered value is mapped to 2, and so on.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please note that this is a common way to code categorical variables. &amp;nbsp;The coding does not impact how 'trustworthy' the segments are since there is no correct distance between red and blue (for example). &amp;nbsp;Clustering was designed for numerical data but like many such methods, it can be adapted for categorical data. &amp;nbsp;If you only have one categorical variable, it might be better to consider building a cluster solution of your numerical variables for each level of your categorical variable. &amp;nbsp; There is no right or wrong cluster solution -- just solutions that are more helpful or less helpful based on your analysis goals. &amp;nbsp; The decision about&amp;nbsp;the best approach is therefore a judgement call for the analyst. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I personally don't like to use categorical variables in clustering since the clusters don't tend to neatly resolve categories which can muddle interpretation. &amp;nbsp; Instead of having a clean break of red and blue into different clusters, you might end up with 80% red and 20% blue in one cluster and 20% red and 80% blue in another. &amp;nbsp; This does not mean that the solution isn't useful -- it just might be more difficult to interpret than two separate cluster solutions - one done for the blue observations and one done for the red observations. &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The colors of my clusters in Segment Plot Window and Segment Size Window are different&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The colors in the Segment Plot window correspond to ranges of values for the variable in question in each segment. &amp;nbsp;You can click on one of the small squares in the legend in order to see the proportion of that range of values which appears in each segment. &amp;nbsp; The colors in Segment Size window correspond to the segment itself, not the range of values for a variable for a particular segment. &amp;nbsp;As a result, there is no expectation that the colors should coincide. &amp;nbsp;The Segment Plot window is easier to understand if you click through the squares representing ranges of values so that you can see where those values are highlighted in the chart itself. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 20:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Clustering/m-p/394747#M6008</guid>
      <dc:creator>DougWielenga</dc:creator>
      <dc:date>2018-02-26T20:08:34Z</dc:date>
    </item>
  </channel>
</rss>

