<?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 can I score new data with the score code? in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838106#M16554</link>
    <description>&lt;P&gt;Well posting just commented code isn't super helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But typically you'd take the score code and insert it into a data step - something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data scored_data;
set new_input_data;

*insert code from scoring;


run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 12 Oct 2022 16:39:55 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-10-12T16:39:55Z</dc:date>
    <item>
      <title>How can I score new data with the score code?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838105#M16553</link>
      <description>&lt;P&gt;I am developing some models in visual analysis, developing 3 models, and I have already chosen which was the winning model, in this case a neural network, I want to export my punctuation code to be able to take it to sas studio, but it has generated many doubts, I don't know exactly where I must pass the new data that I need punctually to the punctuation code that generated the model.&lt;/P&gt;&lt;P&gt;I attach images of the code that is generated in visual analysis.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;this code has about 124,887 lines&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="score_code.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76115iDDACAD75B1E579ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="score_code.JPG" alt="score_code.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 16:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838105#M16553</guid>
      <dc:creator>sateh</dc:creator>
      <dc:date>2022-10-12T16:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I score new data with the score code?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838106#M16554</link>
      <description>&lt;P&gt;Well posting just commented code isn't super helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But typically you'd take the score code and insert it into a data step - something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data scored_data;
set new_input_data;

*insert code from scoring;


run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Oct 2022 16:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838106#M16554</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-12T16:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I score new data with the score code?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838188#M16555</link>
      <description>&lt;P&gt;Thank you for such a quick response, I have one more question, is it possible to call this sas code, from another sas file, to do what you suggest and not have to open it and append the lines you suggest?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 16:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838188#M16555</guid>
      <dc:creator>sateh</dc:creator>
      <dc:date>2022-10-12T16:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I score new data with the score code?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838189#M16556</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data scored_data;
set new_input_data;

%include 'path to files with code' / source2;


run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/369041"&gt;@sateh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for such a quick response, I have one more question, is it possible to call this sas code, from another sas file, to do what you suggest and not have to open it and append the lines you suggest?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 16:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838189#M16556</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-12T16:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I score new data with the score code?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838191#M16557</link>
      <description>Thank you very much, I will try and tell you how it went!!</description>
      <pubDate>Wed, 12 Oct 2022 16:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838191#M16557</guid>
      <dc:creator>sateh</dc:creator>
      <dc:date>2022-10-12T16:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I score new data with the score code?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838607#M16560</link>
      <description>&lt;P&gt;That's a common task when you model in visual analytics.&lt;/P&gt;
&lt;P&gt;It depends on the algorithm you use for learning the model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some require astore technique for scoring and some generate sas code that you can %include like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; said.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those creating an astore let you know by asking for a table name. This means the scoring code is written to the models caslib. These models require other techniques for scoring.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I show you both ways of scoring. the first for a linear regression as example. You create a txt file with the scoring code from VA and reference and include it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE FILESRVC FOLDERPATH='/Projects/SAS Viya training VWFS/'  FILENAME='_2B3_aux lin_reg_sales_res.txt';
data casuser.rema_scored;
set casuser.rema;
%include reffile;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;second&amp;nbsp;one&amp;nbsp;gets&amp;nbsp;implemented&amp;nbsp;by&amp;nbsp;copy-pasting&amp;nbsp;the&amp;nbsp;score&amp;nbsp;code&amp;nbsp;from the VA window (after setting a name for the model) to sas studio. Put the macro variables specific to your environment and run the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there are other scoring techniques like missing value trick, ds2, astore, ...&lt;/P&gt;
&lt;P&gt;here comes proc astore:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc casutil;
load casdata="GB_sales_res_example.sashdat" incaslib="Models"
casout="GB_example" outcaslib="casuser";
run;

proc astore;
describe rstore=casuser.gb_example;
quit;


proc astore;
score data=casuser.rema copyvars=meses_efectivos
rstore=casuser.gb_example
/* epcode="/caslibs/marketing/dmcas_epscorecode.sas" */
out=casuser.rema_scored_astore;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic5.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76179i05D56D1835EEA311/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic5.png" alt="pic5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic3.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76180iE81778637F544BE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic3.png" alt="pic3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic1b.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76182i9F49C0153E7333A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic1b.png" alt="pic1b.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76183iC43CC05122B5EFB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic1.png" alt="pic1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76184iC036D01370FEB04F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic2.png" alt="pic2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic6.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76185i085C1CC77647EDB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic6.png" alt="pic6.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 10:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-can-I-score-new-data-with-the-score-code/m-p/838607#M16560</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-10-14T10:14:04Z</dc:date>
    </item>
  </channel>
</rss>

