API for interacting with saved models¶
This is the main class that you will use in Python recipes and the iPython notebook.
For starting code samples, please see Python recipes.
As an example, see the following example of code to retrieve the associated scikit model with your DSS:
import dataiku m = dataiku.Model(my_model_id) my_predictor = m.get_predictor() my_clf = my_predictor._clf
Model(lookup, project_key=None, ignore_flow=False)¶
This is a handle to interact with a saved model
Retrieve the list of saved models
Parameters: project_key – key of the project from which to list models
Get the unique identifier of the model
Get the name of the model
Get the type of the model, prediction or clustering
List the versions this saved model contains
Activate a version in the model
Parameters: version_id – the unique identifier of the version to activate
Get the training metrics of a version of this model, as a
Parameters: version_id – the unique identifier of the version for which to retrieve metrics
Save checks on this model. The checks are saved with the type “external”
Parameters: values_dict – the values to save, as a dict. The keys of the dict are used as check names
Returns a Predictor for the given version of this Saved Model. If no version is specified, the current active version will be used.