Deploy DataRobot models¶
You can deploy models you build with DataRobot AutoML using the following methods:
- Deploy the model from the Leaderboard.
- Save the model as a model package in the Model Registry and deploy from the registry.
In most cases, before deployment, you should unlock holdout and retrain your model at 100% to improve predictive accuracy. DataRobot automatically runs Feature Impact for the model (this also calculates Prediction Explanations, if available).
Deploy from the Leaderboard¶
To add a deployment from the Leaderboard:
From the Leaderboard, select the model to use for generating predictions and click Predict > Deploy. The Deploy model page lets you create a new deployment for the selected model. In this example, the model is both recommended for deployment and prepared for deployment:
The Deploy tab behaves differently in environments without a dedicated prediction server, as described in the section on shared modeling workers, below.
If the model is not prepared for deployment as in the example below, best practice recommends that you click Prepare for deployment. DataRobot runs feature impact, retrains the model on a reduced feature list, trains on a higher sample size and then the full sample size (latest data for date/time partitioned projects).
If using a binary classification model, set the Prediction threshold before proceeding. (New models added to the Leaderboard are assigned the default value 0.5.)
If you set the prediction threshold before the deployment preparation process, the value does not persist through the process. When deploying the prepared model, if you want it to use a value other than the default, set the value after the model has the Prepared for Deployment badge applied.
To deploy a prepared model, click Deploy model.
Deploy from the Model Registry¶
Navigate to Model Registry > Model Packages.
Select Deploy from the action menu for the model package you wish to deploy.
Use shared modeling workers¶
If you don't have a dedicated prediction server instance available, you can use a node that shares workers with your model building activities. In this case, the page has a different interface.
Click Show Example to generate and display a usage example:
When using the sample code, specify your API key (1). The project and model IDs (2) are available in the sample, as is the shared instance endpoint (3). The DataRobot Python client uses the API key for authentication and so no key or username is required. To execute the file, follow the instructions in the commented section of the snippet.