Join us on August 26th to develop an interactive Credit Scoring web application and deploy it on a Kubernetes cluster Learn more

How to use Python API to score a saved model

Level 1
How to use Python API to score a saved model

I have a trained model on my automation node.  I have created an API key and in an externally running iPython Notebook attached to the saved model as thus:




client = DSSClient(host, apiKey)
sap = dataikuapi.dss.project.DSSProject(client, 'SIMPLEAFFINITYPLUS')
classifier_no_format = sap.get_saved_model('prediction_no_format')


Now, how can I score a single observation using this saved model? Extra points if I can score more than one observation in a single call.

1 Reply
Dataiker
Dataiker

Hello,



The right way to do this is to use the API node, which is a lightweight dedicated node for scoring a single observation (or a couple of them). You create an API service in DSS with your python model, package it & import it into the API node, and you can score with a JSON API.

Check out the documentation: Real-time predictions.



On the other hand, the DSS public API (of the design node & automation node) lets you control DSS itself: export data, change configuration, launch jobs, etc. but is not meant to be called for individual scoring.

Labels (4)