How to use Python API to score a saved model

Stephen_Haptons
Stephen_Haptons Registered Posts: 3 ✭✭✭✭
edited July 16 in Using Dataiku

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.

Answers

  • AdrienL
    AdrienL Dataiker, Alpha Tester Posts: 196 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.

Setup Info
    Tags
      Help me…