-
Notifications
You must be signed in to change notification settings - Fork 10
Scoring with MAS
In this section I discuss how to execute scoring with a model published to MAS using the masSetup and masRun methods of the restaflib library.
This method sets up the necessary information to score with MAS.
let masControl = await restaflib.masSetup(store, models);
The arguments to this method are:
- store - restaf store
- models - An array of model names you want to score with
let masControl = await restaflib.masSetup(store, ['model1',...] );
Use this method to get the input variables
- masControl - the object returned from masSetup
- model - name of the model
- step - the step you are interested in ( defaults to score)
let input = masDescribe(masControl, 'abc', 'xyz);
This is the method you will call to score each scenario
let result = await restaflib.masRun(store, masControl, modelName,scenario, step);
The parameters to this method are;
- store - restaf store
- masControl - the object you got back from casSetup
- modelName - the name of the model you want to use for scoring. Has to have been specified in the models array to casSetup
- scenario - a JS object with the input values(see example below)
- step - this is optional. If not specified the first 'score' in the model will be used for scoring.
async function example () {
let models = ['sdktgo_iris'];
let masControl = await restaflib.masSetup(store, models);
let scenario = {
petallengthcm: 1.5,
petalwidthcm : 0.2,
sepallengthcm: 5,
sepalwidthcm : 3
};
let result = await restaflib.masRun (store, masControl, models[0], scenario);
console.log(result);
}
A sample result for the model used above is:
{ I_Species : 'Iris-setosa ',
P_SpeciesIris_setosa : 1,
P_SpeciesIris_versicolor: 0,
P_SpeciesIris_virginica : 0,
_leaf_id_: 2 }
The methods discussed in this blog use the microanalyticScore REST API
.... Under construction...
-
restaf
-
restaflib
-
Examples:
- Cas Server
- Compute Server
- Scoring with MAS
- Scoring with CAS
- Utility
-
CAS Related Functions
-
MAS Related Functions
-
Compute Server Related Functions
-
Reports Related Functions
-
Interactive CLI
-
Special Topic