Challenger

class datarobot.models.deployment.challenger.Challenger(id, deployment_id=None, name=None, model=None, model_package=None, prediction_environment=None)

A challenger is an alternative model being compared to the model currently deployed

Attributes:
idstr

The ID of the challenger.

deployment_idstr

The ID of the deployment.

namestr

The name of the challenger.

modeldict

The model of the challenger.

model_packagedict

The model package of the challenger.

prediction_environmentdict

The prediction environment of the challenger.

classmethod create(deployment_id, model_package_id, prediction_environment_id, name, max_wait=600)

Create a challenger for a deployment

Parameters:
deployment_idstr

The ID of the deployment

model_package_idstr

The model package id of the challenger model

prediction_environment_idstr

The prediction environment id of the challenger model

namestr

The name of the challenger model

max_waitint, optional

The amount of seconds to wait for successful resolution of a challenger creation job.

Return type:

Challenger

Examples

from datarobot import Challenger
challenger = Challenger.create(
    deployment_id="5c939e08962d741e34f609f0",
    name="Elastic-Net Classifier",
    model_package_id="5c0a969859b00004ba52e41b",
    prediction_environment_id="60b012436635fc00909df555"
)
classmethod get(deployment_id, challenger_id)

Get a challenger for a deployment

Parameters:
deployment_idstr

The ID of the deployment

challenger_idstr

The ID of the challenger

Returns:
Challenger

The challenger object

Return type:

Challenger

Examples

from datarobot import Challenger
challenger = Challenger.get(
    deployment_id="5c939e08962d741e34f609f0",
    challenger_id="5c939e08962d741e34f609f0"
)

challenger.id
>>>'5c939e08962d741e34f609f0'
challenger.model_package['name']
>>> 'Elastic-Net Classifier'
classmethod list(deployment_id)

List all challengers for a deployment

Parameters:
deployment_idstr

The ID of the deployment

Returns:
challengers: list

A list of challenger objects

Return type:

List[Challenger]

Examples

from datarobot import Challenger
challengers = Challenger.list(deployment_id="5c939e08962d741e34f609f0")

challengers[0].id
>>>'5c939e08962d741e34f609f0'
challengers[0].model_package['name']
>>> 'Elastic-Net Classifier'
delete()

Delete a challenger for a deployment

Return type:

None

update(name=None, prediction_environment_id=None)

Update name and prediction environment of a challenger

Parameters:
name: str, optional

The name of the challenger model

prediction_environment_id: str, optional

The prediction environment id of the challenger model

Return type:

None