Model#
- class datarobotx.Model(project_id=None, model_id=None)#
DataRobot training model.
Represents a model on a project leaderboard. Implements prediction and deployment asynchronously.
- Parameters:
Attributes:
DataRobot python client datarobot.Model object.
DataRobot python client datarobot.Project object.
Methods:
deploy
([name, registered_model_id])Deploy the model into ML Ops.
from_url
(url)Class method to initialize from a URL string.
predict
(X, **kwargs)Make batch predictions using the model.
predict_proba
(X, **kwargs)Calculate class probabilities using the model.
- deploy(name=None, registered_model_id=None)#
Deploy the model into ML Ops.
- Parameters:
- Returns:
Resulting ML Ops deployment
- Return type:
- property dr_model: Model#
DataRobot python client datarobot.Model object.
- Returns:
datarobot.Model object associated with this drx.Model
- Return type:
datarobot.Model
- property dr_project: Project#
DataRobot python client datarobot.Project object.
- Returns:
datarobot.Project object associated with this drx.Model
- Return type:
datarobot.Project
- classmethod from_url(url)#
Class method to initialize from a URL string.
Useful for copy and pasting between GUI and notebook environments
- predict(X, **kwargs)#
Make batch predictions using the model.
Predictions are calculated asynchronously - returns immediately but reinitializes the returned DataFrame with data once predictions are completed.
Predictions are made within the project containing the model using modeling workers. For real-time predictions, first deploy the model.
- Parameters:
X (pandas.DataFrame or str) – Dataset to be scored - target column can be included or omitted. If str, can be AI catalog dataset id or name (if unambiguous)
**kwargs (Any) – Other key word arguments to pass to the _predict function
- Returns:
Resulting predictions (contained in the column ‘predictions’) Returned immediately, updated automatically when results are completed. If attribute access is attempted, will block until results are completed.
- Return type:
- predict_proba(X, **kwargs)#
Calculate class probabilities using the model.
Only available for classifier models.
- Parameters:
X (pandas.DataFrame or str) – Dataset to compute class probabilities on; target column can be included or omitted. If str, can be AI catalog dataset id or name (if unambiguous)
**kwargs (Any) – Other key word arguments to pass to the _predict function
- Returns:
Resulting predictions; probabilities for each label are contained in the column ‘class_{label}’; returned immediately, updated automatically when results are completed. If attribute access is attempted, will block until results are completed.
- Return type:
See also