AutoTSModel#

class datarobotx.AutoTSModel(name=None, feature_window=None, forecast_window=None, **kwargs)[source]#

AutoTS orchestrator

Applies automatic feature engineering and a model selection process optimized for the nuances of time-series modeling (e.g. automatic engineering of lag variables, handling of varying forecast horizons).

Parameters:
  • name (str, optional) – Name to use for the DataRobot project that will be created. Alias for the DR ‘project_name’ configuration parameter.

  • feature_window (tuple of int, optional) –

    Window of time relative to the forecast point over which to automatically derive features. Expected format is a tuple: (start, end) e.g. (-20, 0). Larger windows require more data for predictions. Window unit of time is automatically detected but can be explicitly specified separately.

    Alias for the DR ‘feature_derivation_window_start’ and ‘feature_derivation_window_end’ configuration parameters.

  • forecast_window (tuple of int, optional) –

    Window of time relative to the forecast point for which predictions are of interest. Expected format is a tuple: (start, end) e.g. (1, 5). Window unit of time is automatically detected but can be explicitly specified separately.

    Alias for the DR ‘forecast_window_start’ and ‘forecast_window_end’ configuration parameters.

  • **kwargs – Additional DataRobot configuration parameters for project creation and autopilot execution. See the DRConfig docs for usage examples.

See also

DRConfig

Configuration object for DataRobot project and autopilot settings, also includes detailed examples of usage

Inherited attributes:

dr_model

DataRobot python client datarobot.Model object for the present champion

dr_project

DataRobot python client datarobot.Project object

Methods:

fit(X, datetime_partition_column[, target, ...])

Fit time-series challenger models using DataRobot

Inherited methods:

deploy([wait_for_autopilot, name])

Deploy the model into ML Ops

from_project_id(project_id)

Class method to create from an existing project id

from_url(url)

Class method to initialize from a URL string

get_params()

Configuration parameters for the model

predict(X[, wait_for_autopilot])

Make batch predictions using the present champion

predict_proba(X[, wait_for_autopilot])

Calculate class probabilities using the present champion

set_params(**kwargs)

Set or update configuration parameters for the model

share(emails)

Share a project with other users.

deploy(wait_for_autopilot=False, name=None)[source]#

Deploy the model into ML Ops

Return type:

Deployment

Returns:

  • Deployment – Resulting ML Ops deployment

  • wait_for_autopilot (bool, optional, default=False) – If True, wait for autopilot to complete before deploying the model In non-notebook environments, fit() will always block until complete

  • name (str, optional, default=None) – Name for the deployment. If None, a name will be generated

property dr_model: datarobot.Model#

DataRobot python client datarobot.Model object for the present champion

Returns:

datarobot.Model object associated with this drx model

Return type:

datarobot.Model

property dr_project: datarobot.Project#

DataRobot python client datarobot.Project object

Returns:

datarobot.Project object associated with this drx.Model

Return type:

datarobot.Project

fit(X, datetime_partition_column, target=None, multiseries_id_columns=None, **kwargs)[source]#

Fit time-series challenger models using DataRobot

Automatically engineers temporally lagged features and establishes time-series champion models across a forecast horizon of interest.

Parameters:
  • X (pandas.DataFrame) – Training dataset for challenger models. If str, can be AI catalog dataset id or name (if unambiguous)

  • target (str, default=None) – Column name from the dataset to be used as the target variable. If None, TS anomaly detection will be executed.

  • datetime_partition_column (str) – Column name from the dataset containing the primary date/time feature to be used in partitioning, feature engineering, and establishing forecast horizons

  • multiseries_id_columns (str or list of str, optional) – Column name from the dataset containing a series identifier for each row. If specified, DataRobot will treat this as a multiseries problem. Presently only a single series id column is supported.

  • **kwargs – Additional optional fit-time parameters to pass to DataRobot i.e. ‘weights’

See also

DRConfig

Configuration object for DataRobot project and autopilot settings, also includes detailed examples of usage.

Return type:

AutoTSModel

classmethod from_project_id(project_id)[source]#

Class method to create from an existing project id

Initializes a new object from the provided project_id. Configuration parameters originally used to create the project and start Autopilot may not be recoverable.

Parameters:

project_id (str, optional) – DataRobot id for the project from which to initialize the object

Returns:

model – New AutopilotModel instance

Return type:

AutopilotModel

Examples

>>> my_model = AutopilotModel.from_project_id('62f14505bab13ab73593d69e')
classmethod from_url(url)[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 project of interest

Returns:

model – The constructed AutopilotModel object

Return type:

AutopilotModel

get_params()[source]#

Configuration parameters for the model

Note that some parameters may be initialized or materialized server-side after creating a project or starting Autopilot. get_params() only returns the client-side parameters which will be (or were) passed to DataRobot.

Returns:

config – Configuration object containing the parameters to be used with DataRobot

Return type:

DRConfig

predict(X, wait_for_autopilot=False)[source]#

Make batch predictions using the present champion

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) – Dataset to be scored - target column can be included or omitted

  • wait_for_autopilot (bool, optional, default=False) – If True, wait for autopilot to complete before making predictions In non-notebook environments, fit() will always block until complete

Returns:

Resulting predictions (contained in the column ‘predictions’) Returned immediately, updated automatically when results are completed.

Return type:

FutureDataFrame

predict_proba(X, wait_for_autopilot=False)[source]#

Calculate class probabilities using the present champion

Only available for classifier and clustering models.

Parameters:
  • X (pandas.DataFrame) – Dataset to compute class probabilities on; target column can be included or omitted

  • wait_for_autopilot (bool, optional, default=False) – If True, wait for autopilot to complete before making predictions In non-notebook environments, fit() will always block until complete

Returns:

Resulting predictions; probabilities for each label are contained in the column ‘class_{label}’; returned immediately, updated automatically when results are completed.

Return type:

FutureDataFrame

See also

predict

set_params(**kwargs)[source]#

Set or update configuration parameters for the model

Parameters:

**kwargs – DataRobot configuration parameters to be set or updated. See the DRConfig docs for usage examples.

Returns:

self – AutopilotModel instance

Return type:

AutopilotModel

share(emails)[source]#

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

Parameters:

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