Deployment#

class datarobotx.Deployment(deployment_id=None)[source]#

DataRobot ML Ops deployment

Implements real-time predictions on ML Ops deployments

Parameters:

deployment_id (str, optional) – DataRobot id for the deployment from which to initialize the object

Attributes:

dr_deployment

DataRobot python client datarobot.Deployment object

Methods:

from_url([url])

Class method to initialize from a URL string

predict(X[, max_explanations])

Make predictions on X asynchronously using the deployment

predict_proba(X[, max_explanations])

Calculate class probabilities on X asynchronously using the deployment

predict_unstructured(X)

Make predictions with data asynchronously using the deployment

share(emails)

Share a deployment with other users.

property dr_deployment#

DataRobot python client datarobot.Deployment object

Returns:

datarobot.Deployment object associated with this drx.Deployment

Return type:

datarobot.Deployment

classmethod from_url(url=None)[source]#

Class method to initialize from a URL string

Useful for copy and pasting between GUI and notebook environments

Parameters:

url (str) – URL of a DataRobot GUI page related to the deployment of interest

Returns:

model – The deployed model object

Return type:

Deployment

predict(X, max_explanations=None)[source]#

Make predictions on X asynchronously using the deployment

Returns empty DataFrame which will be updated with results when complete

Parameters:
  • X (pd.DataFrame) – Data to make predictions on

  • max_explanations (int or 'all' (default=None)) – Number of explanations to return for each prediction. Note that ‘all’ is supported for deployments using SHAP models only.

Return type:

DataFrame

predict_proba(X, max_explanations=None)[source]#

Calculate class probabilities on X asynchronously using the deployment

Returns empty DataFrame which will be updated with results when complete

Parameters:
  • X (pd.DataFrame) – Data to make predictions on

  • max_explanations (int or 'all' (default=None)) – Number of explanations to return for each prediction. Note that ‘all’ is supported for deployments using SHAP models only.

Return type:

DataFrame

predict_unstructured(X)[source]#

Make predictions with data asynchronously using the deployment

Returns empty dict which will be updated with results when complete

Parameters:

X (dict) – Data to make predictions on

Return type:

dict

share(emails)[source]#

Share a deployment with other users. Sets the user role as an owner of the deployment.

Parameters:

emails (Union[str, list]) – A list of email addresses of users to share with