BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
azaras
Obsidian | Level 7

Hello,

 

I want to score a table using the astore code derived from SAS Visual TA in SAS VFL. What shuld i put in the following paramters (let cas_server_port, cas_server_hostname)?

 

Thanks,

 

Andreas


%let cas_server_hostname = "localhost";

%let cas_server_port = 5570;

1 ACCEPTED SOLUTION

Accepted Solutions
RussAlbright
SAS Employee

Hi @azaras   and @sbxkoenk ,
I don't think you need epcode in this environment. You can just run the AstoreScoreCode.sas after setting some of the macro variables. Directions are in the file itself.  Can you give that a try, @azaras ? Thanks
Russ


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

View solution in original post

12 REPLIES 12
sbxkoenk
SAS Super FREQ

Hello,

 

I guess :

  • SAS Visual TA = SAS Visual Text Analytics
  • SAS VFL = SAS Viya for Learners

 

So, I moved this topic to "Data Science"-board (more appropriate board for this question).
I suppose "Model Studio" (for VTA) was used here, and not "Visual Analytics".

 

BR, Koen

azaras
Obsidian | Level 7
You are correct. Thanks!
azaras
Obsidian | Level 7

I use the code at the end of the post.

 

I receive the following error:

Any hints on how to score?

ERROR: The caslib '{CASUSER}' does not exist.
ERROR: Table '{ASRS}' could not be loaded.
ERROR: Failure opening table '{ASRS}'
ERROR: The caslib '{CASUSER}' does not exist.
ERROR: The action stopped due to errors.
 
 

 

 

 


%let input_caslib_name = "{CASUSER}";

%let input_table_name = "{ASRS}";

%let copy_vars_variable = "{'docID', 'ID','Text', 'Target05'}";

%let output_caslib_name = "{CASUSER}";

%let output_documents_table_name = "SCORED_TA";

%let input_astore_caslib_name = "Analytics_Project_1bcf9786-5598-4242-a05c-8f6093fc9373";

%let input_astore_name = "53a5b832-c925-4ee9-b641-8a50f3226aae_TEXT_MODEL";

%let cas_server_hostname = "pdcesx23103.exnet.sas.com";

%let cas_server_port = 5570;


cas sascas1 host=&cas_server_hostname port=&cas_server_port;
libname sascas1 cas sessref=sascas1 datalimit=all;


proc cas;
session sascas1;
loadactionset "astore";

action astore.score;
param
table={caslib=&input_caslib_name, name=&input_table_name}
rstore={caslib=&input_astore_caslib_name, name=&input_astore_name}
out={caslib=&output_caslib_name, name=&output_documents_table_name, replace=TRUE}
copyVars={&copy_vars_variable};
;
run;
quit;

 

sbxkoenk
SAS Super FREQ

Have you carefully followed the steps outlined here?

BR, Koen

azaras
Obsidian | Level 7

Hi,

 

I read the instructions. I had forgotten to upload the astore table in cas.

 

I did it with the following proc:

 


%let local_astore_file_path = "/shared/home/azaras@aueb.gr/casuser";
%let input_astore_caslib_name = "casuser";

%let input_astore_name = "astore_2";

%let input_astore_name_unquoted = %qsysfunc(dequote(&input_astore_name))

proc astore;
upload rstore=public.&input_astore_name_unquoted
store=&local_astore_file_path;
quit;

The astore_2 is created in public. When i try to open it in the data grid i get the following:

 

azaras_0-1699563691171.png

 

I continue with the action astore score but since the uploaded into cas astore table has a problem there the code cannot run.

 

 

Any ideas what is the problem?

 

Thanks in advance,

 

Andreas

 

sbxkoenk
SAS Super FREQ

Hello,

 

How do you know there's a problem with the uploaded-into-CAS ASTORE?

That ASTORE is a binary analytic store. You cannot visualize it with the table viewer.

 

What happens when you try to use that ASTORE for scoring?

 

BR, Koen

azaras
Obsidian | Level 7

Hi Koen,

Thanks for your answer.

When i try to score with the created astore cas table i receive the following error:

ERROR: Store contents have been modified. Cannot continue.
ERROR: Action score failed.
ERROR: The action stopped due to errors.
 
Any ideas?

 

proc cas;
123 session mysess;
124 loadactionset "astore";
125
126 action astore.score;
127 param
128 table={caslib=&input_caslib_name, name=&input_table_name}
129 rstore={caslib=&input_astore_caslib_name, name=&input_astore_name}
130 out={caslib=&output_caslib_name, name=&output_table_name, replace=TRUE}
131 copyVars={&copy_vars_variables};
132 ;
133 run;
NOTE: Active Session now mysess.
NOTE: Added action set 'astore'.
ERROR: Store contents have been modified. Cannot continue.
ERROR: Action score failed.
ERROR: The action stopped due to errors.
134 quit;
NOTE: PROCEDURE CAS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
135
136
137
138 %studio_hide_wrapper;
149
150
 

 

sbxkoenk
SAS Super FREQ

Hello,

 

Can you try something like this?

 

For Scoring new data from SAS Studio using score files (DS2 code and an ASTORE binary file) from VTA pipelines :

 

Q: How can we score new data in SAS Studio using EP code files downloaded from Model Studio?

 

**ANSWER**

If you downloaded the ASTORE (.sasast) then you need to upload it to CAS to use in scoring. The epcode is used if you have preprocessing code in your flow. If the ASTORE file is already loaded to CAS, you do not need to upload it again.

 

 

proc astore;
   upload rstore=mycaslib._astore_wine
   store="~/aBc/xYz/Demo/_36AAV34SH5MWA1ASPCRW1AYAD.sasast"; 
/* the astore that you downloaded from Model Studio */
   score data=mycaslib.winequality_jw out=mycaslib._scored_wine3
   rstore=mycaslib._astore_wine
   epcode="~/aBc/xYz/Demo/dmcas_epscorecode.sas"; 
/* the epcode that was downloaded from Model Studio */
run; QUIT;

 

 

BR, Koen

azaras
Obsidian | Level 7
Hi koen,
Thanks for your answer.
When I download the code from visual text analytics Viya for learners- topics node - I get two files astorescorecode.sas and topicsmodel.astore. I don't get any ep file.
Any idea?
sbxkoenk
SAS Super FREQ

Hello @smanoj ,

Hello @themaryosborne ,

Hello @RussAlbright ,

 

Can you help?
I can probably sort it out by setting up a VTA-pipeline myself, but I have no time for that right now.

 

Thanks,

Koen

RussAlbright
SAS Employee

Hi @azaras   and @sbxkoenk ,
I don't think you need epcode in this environment. You can just run the AstoreScoreCode.sas after setting some of the macro variables. Directions are in the file itself.  Can you give that a try, @azaras ? Thanks
Russ


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

azaras
Obsidian | Level 7

Thnaks Russ and all the friends that contributed to my question. 

 

You were right, i checked carefully the code that is downloaded from the SAS Visual Text Analytics and i can score a new data set by filling in the macro variables. Actually the scored data set is saved in a cas library called sascas1 that is created by the code, although i set the library to casuser. This is why i could not find the scored data set and i initiated the post. So if someone else tries this action the scored data set can be found in the sascas1 cas library.

 

/* specifies the CAS library to write the score output table. You must modify the value to provide the name of the library that will contain the output table that the score code produces. */
%let output_caslib_name = "casuser";

 

cas sascas1 host=&cas_server_hostname port=&cas_server_port;
libname sascas1 cas sessref=sascas1 datalimit=all;

 

 

Thanks!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 12 replies
  • 2098 views
  • 11 likes
  • 3 in conversation