<?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: How to Predict Cluster Group of New Observations in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/433741#M6667</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be used but you can predict cluster membership of new observation based on it's distance from the closest cluster center..&lt;/P&gt;</description>
    <pubDate>Sat, 03 Feb 2018 01:28:05 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2018-02-03T01:28:05Z</dc:date>
    <item>
      <title>How to Predict Cluster Group of New Observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/433666#M6666</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After creating&amp;nbsp;5 cluster groups&amp;nbsp;(using k-Means Algorithm) from my data set&amp;nbsp;based on 4 continuous variables, I was wondering if it is valid to use the cluster group ids (1 to 5) as an dependent variable in a multinomial logistic regression (using the same 4 continuous variables in the clustering algorithm as independent variables) to predict the cluster groups of new observations (with the same 4 continuous variables)?&amp;nbsp; Note that data for 3 of my 4 independent variables are highly skewed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above method is valid, not sure which other types of classifiers (i.e. KNN, Decision Trees, SVMs, etc.) would be best to predict cluster group for new observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 18:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/433666#M6666</guid>
      <dc:creator>Data_Guy</dc:creator>
      <dc:date>2018-02-02T18:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to Predict Cluster Group of New Observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/433741#M6667</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be used but you can predict cluster membership of new observation based on it's distance from the closest cluster center..&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 01:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/433741#M6667</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2018-02-03T01:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to Predict Cluster Group of New Observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/859911#M10437</link>
      <description>&lt;P class="md-end-block md-p md-focus"&gt;&lt;SPAN class="md-plain md-expand"&gt;I know that this is an old post but I found it during my own searching on this topic and wanted to provide the solution that I used so that it might help others. There is really good documentation on this but it is in different documents and this seems like a good place to link it all together.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="md-end-block md-p md-focus"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="md-end-block md-p md-focus"&gt;&lt;SPAN class="md-plain"&gt;A quick note before the solution below: I am working with data in CAS on SAS Viya but the below should be relevant for Viya 3.x if you're working on that version too. The general concept is valid also SAS9 (I believe), but the steps will be significantly different.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="md-end-block md-p md-focus"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="md-end-block md-p"&gt;&lt;SPAN class="md-plain"&gt;Similarly to you, I have performed a k-Means clustering on some data and I wanted to generate a model that can help me to put new records into the appropriate clusters that I have already created. Using &lt;/SPAN&gt;&lt;SPAN class="md-meta-i-c  md-link"&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_035/casactstat/casactstat_clustering_examples01.htm" target="_blank"&gt;&lt;SPAN class="md-plain"&gt;this example from the documentation&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="md-plain"&gt;, we can simply add the following additional option just above the &lt;/SPAN&gt;&lt;SPAN class="md-pair-s"&gt;&lt;CODE&gt;run&lt;/CODE&gt;&lt;/SPAN&gt;&lt;SPAN class="md-plain"&gt; statement of our &lt;/SPAN&gt;&lt;SPAN class="md-pair-s"&gt;&lt;CODE&gt;proc cas&lt;/CODE&gt;&lt;/SPAN&gt;&lt;SPAN class="md-plain"&gt; call to save a model in CAS as an ASTORE which can then be used to "score" other records:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="md-end-block md-p"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" lang="sas" spellcheck="false"&gt;&amp;nbsp;&lt;SPAN&gt;saveState&lt;SPAN class="cm-operator"&gt;={&lt;/SPAN&gt;name&lt;SPAN class="cm-operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="cm-string"&gt;"PetalModel"&lt;/SPAN&gt;&lt;SPAN class="cm-operator"&gt;,&lt;/SPAN&gt; replace&lt;SPAN class="cm-operator"&gt;=&lt;/SPAN&gt;True&lt;SPAN class="cm-operator"&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P class="md-end-block md-p"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="md-end-block md-p"&gt;&lt;SPAN class="md-plain"&gt;From this, I can use the &lt;/SPAN&gt;&lt;SPAN class="md-meta-i-c md-link"&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_035/casactml/casactml_astore_toc.htm" target="_blank"&gt;&lt;SPAN class="md-plain"&gt;aStore action set&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="md-plain"&gt; to pass one or more records into my model:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="md-end-block md-p"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;proc cas;
&amp;nbsp;  loadactionset "aStore";
&amp;nbsp;  action aStore.score /
&amp;nbsp; &amp;nbsp; &amp;nbsp;table={name='NEWPETALS'},
&amp;nbsp; &amp;nbsp; &amp;nbsp;out={name='SCORED_NEWPETALS'},
&amp;nbsp; &amp;nbsp;  rstore={name='PetalModel'};
&amp;nbsp;run;
&amp;nbsp;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="md-end-block md-p"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="md-end-block md-p"&gt;&lt;SPAN class="md-plain"&gt;For more information about your model including checking what the input data shape should be and what you can expect to get in the output table, you can use the &lt;/SPAN&gt;&lt;SPAN class="md-meta-i-c md-link"&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_035/casactml/casactml_astore_examples01.htm" target="_blank"&gt;&lt;SPAN class="md-plain"&gt;describe method&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="md-plain"&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="md-end-block md-p"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;proc cas;
&amp;nbsp; &amp;nbsp; aStore.describe rstore={name='PetalModel'}, epcode=TRUE;
&amp;nbsp; &amp;nbsp; run;
&amp;nbsp;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="md-end-block md-p"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="md-end-block md-p md-focus"&gt;&lt;SPAN class="md-plain md-expand"&gt;Hope that helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 12:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/859911#M10437</guid>
      <dc:creator>cj_blake</dc:creator>
      <dc:date>2023-02-21T12:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Predict Cluster Group of New Observations</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/859998#M10438</link>
      <description>&lt;P&gt;Usage Note 22544: Assigning new observations to clusters defined using previous data&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/22/544.html" target="_blank"&gt;https://support.sas.com/kb/22/544.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 19:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-Predict-Cluster-Group-of-New-Observations/m-p/859998#M10438</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-02-21T19:53:13Z</dc:date>
    </item>
  </channel>
</rss>

