pdstools.infinity.resources.prediction_studio.v24_2.champion_challenger._sync

Classes

ChampionChallenger

The ChampionChallenger class manages champion and challenger models

Module Contents

class ChampionChallenger(client, prediction_id: str, active_model, cc_id: str | None = None, context: str | None = None, category: str | None = None, challenger_model=None, champion_percentage: float | None = None, model_objective: str | None = None)

Bases: pdstools.infinity.resources.prediction_studio.v24_2.champion_challenger._mixin._ChampionChallengerV24_2Mixin, pdstools.infinity.resources.prediction_studio.base.ChampionChallenger

The ChampionChallenger class manages champion and challenger models within a prediction context. It provides functionalities for:

  • Refreshing champion challenger data

  • Deleting challenger models

  • Promoting challenger models

  • Updating challenger response percentages

  • Adding new models

  • Cloning an ADM active model

  • Adding/removing predictors

Parameters:
  • prediction_id (str)

  • cc_id (str | None)

  • context (str | None)

  • category (str | None)

  • champion_percentage (float | None)

  • model_objective (str | None)

client

The client used to interact with the API.

Type:

Client

prediction_id

The ID of the prediction.

Type:

str

active_model

The active model in the prediction.

Type:

Model

cc_id

The ID of the champion challenger.

Type:

str | None

context

The context of the prediction.

Type:

str | None

category

The category of the prediction.

Type:

str | None

challenger_model

The challenger model.

Type:

Model | None

champion_percentage

The percentage of responses attributed to the champion model.

Type:

float | None

model_objective

The objective of the model.

Type:

str | None

list_available_models_to_add(return_df: bool = False) pdstools.infinity.internal._pagination.PaginatedList | polars.DataFrame

Fetches a list of models eligible to be challengers.

Queries for models that can be added as challengers to the current prediction for the current active model. Offers the option to return the results in a DataFrame format for easier data handling.

Parameters:

return_df (bool, optional) – Determines the format of the returned data: a DataFrame if True, otherwise a list of model instances. Defaults to False.

Returns:

A list of model instances or a DataFrame of models, based on the return_df parameter choice.

Return type:

PaginatedList[Model] or pl.DataFrame