<?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 output ASE for training, validation and testing. in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211808#M3012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, I don't use HP GLM node since it has limitation for polynomial degree (up to 3). I need a little bit higher than that.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Indeed, I need these variables: &amp;amp;em_import_validate, &amp;amp;em_export_validate,&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&amp;amp;em_export_train. However, I don't know what my equation looks like before I ran my model. For instance, I did a nonlinear model as follows to calculate the ASE:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;model Yt_1 = Y / (a + b * Y)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;data EM_IMPORT_VALIDATE_est;&lt;/P&gt;&lt;P&gt;set &amp;amp;EM_IMPORT_VALIDATE. ;&lt;/P&gt;&lt;P&gt;_res2 = (Y1- (Y / (aa + bb *Y) ) )**2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=EM_IMPORT_VALIDATE_est noprint;&lt;/P&gt;&lt;P&gt;var _res2;&lt;/P&gt;&lt;P&gt;output out=&amp;amp;EM_EXPORT_VALIDATE(drop=_:) n=validate_n sum=validate_sse;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;validate_ase=validate_sse/(validate_n-2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way, I can calculate my ASE for validation portion. My problem here is:&lt;/P&gt;&lt;P&gt;1 if I don't know my predict equation ahead, how can I code to calculate ASE?&lt;/P&gt;&lt;P&gt;2.Without code calculating ASE,&amp;nbsp; I can still calculate the overall ASE for the entire data set by using the obtained regression equation. But how can I figure out which portion of the data set was used to do training and which portion is used to do validation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2015 19:20:09 GMT</pubDate>
    <dc:creator>viva0521</dc:creator>
    <dc:date>2015-06-23T19:20:09Z</dc:date>
    <item>
      <title>How to output ASE for training, validation and testing.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211806#M3010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a SAS newbie and now I am working on some simple linear regression in SAS enterprise miner. I am wondering how can I output the ASE for training, validation and testing respectively. &lt;/P&gt;&lt;P&gt;My flow chart is like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File imported----&amp;gt;data partition (Training, validation, test)-------&amp;gt;code node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code node was written as: &lt;/P&gt;&lt;P&gt;ods trace on;&lt;/P&gt;&lt;P&gt;proc glmselect DATA=&amp;amp;EM_IMPORT_DATA;&lt;/P&gt;&lt;P&gt;effect MyPoly = polynomial(A B C/degree=4);&amp;nbsp; &lt;/P&gt;&lt;P&gt;model Y = MyPoly;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods trace off;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 01:34:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211806#M3010</guid>
      <dc:creator>viva0521</dc:creator>
      <dc:date>2015-06-23T01:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to output ASE for training, validation and testing.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211807#M3011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You are doing some advanced stuff!&lt;/P&gt;&lt;P&gt;If you have a recent Enterprise Miner version, the easiest is to use the HPGLM node to do your model. And then add a Model Comparison node.&lt;/P&gt;&lt;P&gt;To code your own proc on a SAS Code node you need to use some macro variables so that the Model comparison node catches your partitions correctly. You are on a good track! In addition to &amp;amp;em_import_ data we need the corresponding &amp;amp;em_import_validate, &amp;amp;em_export_validate, &amp;amp;em_export_train, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try HPGLM node while someone posts a workaround to use proc glmselect on a SAS Code node.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps!&lt;/P&gt;&lt;P&gt;-Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 17:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211807#M3011</guid>
      <dc:creator>M_Maldonado</dc:creator>
      <dc:date>2015-06-23T17:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to output ASE for training, validation and testing.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211808#M3012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, I don't use HP GLM node since it has limitation for polynomial degree (up to 3). I need a little bit higher than that.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Indeed, I need these variables: &amp;amp;em_import_validate, &amp;amp;em_export_validate,&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;&amp;amp;em_export_train. However, I don't know what my equation looks like before I ran my model. For instance, I did a nonlinear model as follows to calculate the ASE:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;model Yt_1 = Y / (a + b * Y)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;data EM_IMPORT_VALIDATE_est;&lt;/P&gt;&lt;P&gt;set &amp;amp;EM_IMPORT_VALIDATE. ;&lt;/P&gt;&lt;P&gt;_res2 = (Y1- (Y / (aa + bb *Y) ) )**2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=EM_IMPORT_VALIDATE_est noprint;&lt;/P&gt;&lt;P&gt;var _res2;&lt;/P&gt;&lt;P&gt;output out=&amp;amp;EM_EXPORT_VALIDATE(drop=_:) n=validate_n sum=validate_sse;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;validate_ase=validate_sse/(validate_n-2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way, I can calculate my ASE for validation portion. My problem here is:&lt;/P&gt;&lt;P&gt;1 if I don't know my predict equation ahead, how can I code to calculate ASE?&lt;/P&gt;&lt;P&gt;2.Without code calculating ASE,&amp;nbsp; I can still calculate the overall ASE for the entire data set by using the obtained regression equation. But how can I figure out which portion of the data set was used to do training and which portion is used to do validation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 19:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211808#M3012</guid>
      <dc:creator>viva0521</dc:creator>
      <dc:date>2015-06-23T19:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to output ASE for training, validation and testing.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211809#M3013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, it took some googling, but I got this working.&lt;/P&gt;&lt;P&gt;You have a couple options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) you pass the train, validation, and test sets using the macro variables so that a Model Comparison node can pick up the partition and calculate the stats.&lt;/P&gt;&lt;P&gt;2) &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;take advantage of the specific proc syntax. I think this is what you were trying to do:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="code your own glmselect flow.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/10976_code your own glmselect flow.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Add a data set. In my example I used German Credit from F1-&amp;gt;Generate Sample Data Sources&lt;/P&gt;&lt;P&gt;2. Add a Partition node&lt;/P&gt;&lt;P&gt;3. Add a SAS code node with the code below. Change the bold for your own target (response) and inputs (effects).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data mydata;&lt;/P&gt;&lt;P&gt;set &amp;amp;EM_IMPORT_DATA(in=a) &amp;amp;EM_IMPORT_VALIDATE(in=b) &amp;amp;EM_IMPORT_TEST(in=c);&lt;/P&gt;&lt;P&gt;if a then _partition="_Train";&lt;/P&gt;&lt;P&gt;else if b then _partition="_Valid";&lt;/P&gt;&lt;P&gt;else if c then _partition="_Test";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc glmselect DATA=mydata;&lt;/P&gt;&lt;P&gt;effect MyPoly = polynomial(&lt;STRONG&gt;duration checking savings&lt;/STRONG&gt;/degree=4); &lt;/P&gt;&lt;P&gt;model &lt;STRONG&gt;amount&lt;/STRONG&gt; = MyPoly;&lt;/P&gt;&lt;P&gt;partition rolevar=_partition(TEST='_Test' TRAIN='_Train' VALIDATE='_Valid');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Run.&lt;/P&gt;&lt;P&gt;The output results will give you the ASE of training/validation/testing.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sas code glmselect output.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10975_sas code glmselect output.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;This model isn't fabulous for this data set but hopefully this approach will give you good results on yours!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;-m&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good reference: &lt;A href="http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glmselect_sect012.htm" title="http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glmselect_sect012.htm"&gt;SAS/STAT(R) User's Guide, proc glm select - partition statement&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS If you try the other approach I described, you can easily use a Model Comparison node to compare with HPGLM or any of the model nodes in Enterprise Miner. Very recommended to give this a try!!!!!!!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 20:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/How-to-output-ASE-for-training-validation-and-testing/m-p/211809#M3013</guid>
      <dc:creator>M_Maldonado</dc:creator>
      <dc:date>2015-06-23T20:21:57Z</dc:date>
    </item>
  </channel>
</rss>

