But wait! What is a pipeline template? You can build model pipelines in Model Studio and store them to the "Exchange" as a template. For more information see here.
filename resp "%substr(&mypath.,11)/resp.json";
proc http
method="GET"
url="https://servername/mlPipelineAutomation/pipelineTemplates?filter=and(eq(modifiedBy,'viyademo01'))"
ct="application/vnd.sas.collection+json"
oauth_bearer = sas_services
out=resp;
run;
libname resp json "%substr(&mypath.,11)/resp.json" map="resp.map" automap=create;
proc json out=filepl pretty;
write open object;
write values "dataTableUri" "/dataTables/dataSources/cas~fs~cas-shared-default~fs~Public/tables/&tablename.";
write values "type" "predictive";
write values "name" "&targetname.";
write values "description" "&targetname. automatic project";
write values "settings";
write open object;
write values "autoRun" &auto.;
write values "modelingMode" "Standard";
write values "applyGlobalMetadata" &global.;
write values "maxModelingTime" 100;
write close;
write values "pipelineBuildMethod" "template";
write values "analyticsProjectAttributes";
write open object;
write values "targetVariable" "&targetname.";
write values "partitionEnabled" true;
write values "classSelectionStatistic" "&statistic.";
write close;
write values "links";
write open array;
write open object;
write values "method" "GET";
write values "rel" "initialPipelineTemplate";
write values "href" "/mlPipelineAutomation/pipelineTemplates/&templateid.";
write values "uri" "/mlPipelineAutomation/pipelineTemplates/&templateid.";
write values "type" "application/octet-stream";
write close;
write close;
write close;
run;
proc http
method="POST"
url="https://servername/mlPipelineAutomation/projects"
ct="application/vnd.sas.analytics.ml.pipeline.automation.project+json"
in=filepl
oauth_bearer = sas_services
out=model;
run;
proc http
method="GET"
url="https://servername/mlPipelineAutomation/projects?filter=eq(modifiedBy,'viyademo01')"
ct="application/vnd.sas.collection+json"
oauth_bearer = sas_services
out=autop;
run;
filename reports "%substr(&mypath.,11)/reports.json";
proc http
method="GET"
url="https://servername/mlPipelineAutomation/projects/f7cacaf3-092b-45d3-9c7a-d72d2ed764b8/models/@championModel/reports"
ct="application/vnd.sas.collection+json"
oauth_bearer = sas_services
out=reports;
run;
libname reports json "%substr(&mypath.,11)/reports.json" map="reports.map" automap=create;
SAS is continuing to enhance Model Studio to be more flexible in areas like multiple target specification, but until those features are released there are also ways you can help yourself here using the MLPA API and custom steps in SAS Studio. So, this is just an example of what can be done with MLPA.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.