sassas-studio

I have trained a Forest model in SAS Model Studio. How do I apply it in SAS Studio?


I have been using SAS Model Studio to train various models. For several models, including Linear Regression and Decision Tree models, there is a section of the output called 'Path EP Score Code' that I can copy-paste into Model studio and apply to data as needed. This works just fine.

When I train a Forest model in SAS Model Studio, the same Path EP Score Code output is not available, and the code that is available in the output appears to make reference to model tables scored in CAS.

How can I take a model that is trained in SAS Model Studio, and apply it to data in SAS Studio?


Solution

  • To run it in SAS Studio via the downloaded file without publishing it to Model Manager:

    1. Download the score code and save it somewhere on the server

    enter image description here

    1. Open SAS Studio
    2. Start a CAS session
    3. Load your astore file (you can get the file name from the notes in the downloaded code)
    4. Run proc astore and point to your scoring file and loaded astore

    Example:

    cas;
    caslib _ALL_ assign;
    
    proc casutil incaslib='models' outcaslib='models';
        load casdata = '_56JR1BZ568NF5CSP46JF82HDC_ast.sashdat' 
             casout  = '_56JR1BZ568NF5CSP46JF82HDC_ast' 
             replace
        ;
    quit;
    
    proc astore;
        score data   = public.baseball
              rstore = models._56JR1BZ568NF5CSP46JF82HDC_ast
              epcode = '/path/to/score/code/on/server'
              out    = casuser.scored_data;
    quit;