<?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 Export scoring code for Cross Validation in SAS Enterprise Miner in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304596#M4515</link>
    <description>&lt;P&gt;I have used start groups and end groups nodes to perform 5-fold cross validation on a modelling node in SAS EM, grouping on a random variable in my training data which I created for this purpose.&amp;nbsp; I now wish to use the model I have created to score up a new dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I export the scoring code I can see that it is referencing the random variable that I created for the purpose of cross-validation in the scoring code, but this variable is not present in my new data as it was only created for the purpose of the cross-validation.&amp;nbsp; Unless I am mis-reading the code it appears to use the value of the random variable to score each of the 5 segments of the data differently.&amp;nbsp; The datasets which I am scoring in the live environment could be fairly small (only a fewthousand records at a time so I don't feel that this would be appropriate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I apply the scoring code to my new data so that every observation is scored consistently?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2016 10:35:59 GMT</pubDate>
    <dc:creator>DavidWilson</dc:creator>
    <dc:date>2016-10-14T10:35:59Z</dc:date>
    <item>
      <title>Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304596#M4515</link>
      <description>&lt;P&gt;I have used start groups and end groups nodes to perform 5-fold cross validation on a modelling node in SAS EM, grouping on a random variable in my training data which I created for this purpose.&amp;nbsp; I now wish to use the model I have created to score up a new dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I export the scoring code I can see that it is referencing the random variable that I created for the purpose of cross-validation in the scoring code, but this variable is not present in my new data as it was only created for the purpose of the cross-validation.&amp;nbsp; Unless I am mis-reading the code it appears to use the value of the random variable to score each of the 5 segments of the data differently.&amp;nbsp; The datasets which I am scoring in the live environment could be fairly small (only a fewthousand records at a time so I don't feel that this would be appropriate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I apply the scoring code to my new data so that every observation is scored consistently?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 10:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304596#M4515</guid>
      <dc:creator>DavidWilson</dc:creator>
      <dc:date>2016-10-14T10:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304597#M4516</link>
      <description>&lt;P&gt;When you build your model wouldn't that variable have been excluded?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Im not sure how you used it in CV.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 10:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304597#M4516</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-14T10:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304605#M4517</link>
      <description>&lt;P&gt;I have created the random variable (called fold), given it values 1-5 and assigned it to the role segment as advised in the answer by m_maldonado to the question (&lt;A href="https://communities.sas.com/t5/SAS-Data-Mining/Using-cross-validation-in-Enterprise-Miner/m-p/233635/highlight/true#M3313" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Mining/Using-cross-validation-in-Enterprise-Miner/m-p/233635/highlight/true#M3313&lt;/A&gt;) link in brackets.&amp;nbsp; I have then used start groups and end groups to perform the cross validation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The random variable does not appear in the model as a predictor but in the scoring code each of the 5 segments is scored differently according to which fold they are in.&amp;nbsp;&amp;nbsp;I don't see how to apply this to a new dataset unless I also create the random variable on my new data wich does not seem to make sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 10:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304605#M4517</guid>
      <dc:creator>DavidWilson</dc:creator>
      <dc:date>2016-10-14T10:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304644#M4518</link>
      <description>&lt;P&gt;Cross validation is used to verify results. Definitely shouldn't have different models for each segment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shouldnt the scoring code you use be from steps before the cross validation?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 12:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304644#M4518</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-14T12:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304646#M4519</link>
      <description>&lt;P&gt;You should also wait for an answer from Miguel or someone else my EM skills have gotten really rusty &lt;span class="lia-unicode-emoji" title=":slightly_frowning_face:"&gt;🙁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 12:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304646#M4519</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-14T12:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304653#M4520</link>
      <description>No problem. Many thanks for trying to help!&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Oct 2016 13:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304653#M4520</guid>
      <dc:creator>DavidWilson</dc:creator>
      <dc:date>2016-10-14T13:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304721#M4522</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;
&lt;P&gt;Sorry I am late to the party.&lt;/P&gt;
&lt;P&gt;I don't have EM handy. Sadly I spend more time in meetings than on hands-on software these days.&lt;/P&gt;
&lt;P&gt;This is the kind of thing that I would suggest fixing directly on the score code while someone figures out the right way to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a chance, post the score code of the flow you have (the simpler the data the better), and the community and myself will give you suggestions!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;-M&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 16:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304721#M4522</guid>
      <dc:creator>M_Maldonado</dc:creator>
      <dc:date>2016-10-14T16:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304918#M4537</link>
      <description>&lt;P&gt;Thanks Miguel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created my own workaround to this by taking the score code generated and adapting it to score my whole dataset 5 times (once for each fold) and then calculating the average of the predicted probabilities from each model on each observation, which if I am understanding the method correctly from my reading is what is required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll try to create an example version of what I have done with some standard data so that I can post the score code - what would you need, an xml of the diagram?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meantime thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2016 11:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304918#M4537</guid>
      <dc:creator>DavidWilson</dc:creator>
      <dc:date>2016-10-16T11:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Export scoring code for Cross Validation in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304959#M4540</link>
      <description>&lt;P&gt;I like that workaround!&lt;/P&gt;
&lt;P&gt;XML of the diagram or a quick screenshot, or both &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When you have a chance, I am also very curious to know more about your learnings about cross validation. In particular, do you feel like you get more predictive power, or anything else you might share?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2016 23:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Export-scoring-code-for-Cross-Validation-in-SAS-Enterprise-Miner/m-p/304959#M4540</guid>
      <dc:creator>M_Maldonado</dc:creator>
      <dc:date>2016-10-16T23:38:59Z</dc:date>
    </item>
  </channel>
</rss>

