pdstools.infinity.resources.prediction_studio.v24_2¶
Submodules¶
- pdstools.infinity.resources.prediction_studio.v24_2.champion_challenger
- pdstools.infinity.resources.prediction_studio.v24_2.datamart_export
- pdstools.infinity.resources.prediction_studio.v24_2.model
- pdstools.infinity.resources.prediction_studio.v24_2.model_upload
- pdstools.infinity.resources.prediction_studio.v24_2.prediction
- pdstools.infinity.resources.prediction_studio.v24_2.prediction_studio
- pdstools.infinity.resources.prediction_studio.v24_2.repository
Classes¶
The |
|
The |
|
v24.2 DatamartExport business logic — defined once. |
|
v24.2 DatamartExport business logic — defined once. |
|
v24.2 Model business logic — defined once. |
|
v24.2 Model business logic — defined once. |
|
Async variant of the v24.2 Prediction. |
|
The |
|
v24.2 PredictionStudio business logic — shared parts. |
|
v24.2 PredictionStudio business logic — shared parts. |
|
v24.2 Repository data — defined once. |
|
v24.2 Repository data — defined once. |
Package Contents¶
- class AsyncChampionChallenger(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:
_ChampionChallengerV24_2Mixin,pdstools.infinity.resources.prediction_studio.base.AsyncChampionChallengerThe
ChampionChallengerclass 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:
- client¶
The client used to interact with the API.
- Type:
Client
- champion_percentage¶
The percentage of responses attributed to the champion model.
- Type:
float | None
- async list_available_models_to_add(return_df: bool = False) pdstools.infinity.internal._pagination.AsyncPaginatedList | polars.DataFrame¶
Fetches a list of models eligible to be challengers.
- Parameters:
return_df (bool, optional) – Determines the format of the returned data: a DataFrame if True, otherwise an async list of model instances. Defaults to False.
- Returns:
An async list of model instances or a DataFrame of models.
- Return type:
AsyncPaginatedList[AsyncModel] or pl.DataFrame
- 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:
_ChampionChallengerV24_2Mixin,pdstools.infinity.resources.prediction_studio.base.ChampionChallengerThe
ChampionChallengerclass 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:
- client¶
The client used to interact with the API.
- Type:
Client
- champion_percentage¶
The percentage of responses attributed to the champion model.
- Type:
float | 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_dfparameter choice.- Return type:
PaginatedList[Model] or pl.DataFrame
- class AsyncDatamartExport(client, referenceId: str, location: str, repositoryName: str)¶
Bases:
_DatamartExportV24_2Mixin,pdstools.infinity.resources.prediction_studio.base.AsyncDataMartExportv24.2 DatamartExport business logic — defined once.
- class DatamartExport(client, referenceId: str, location: str, repositoryName: str)¶
Bases:
_DatamartExportV24_2Mixin,pdstools.infinity.resources.prediction_studio.base.DataMartExportv24.2 DatamartExport business logic — defined once.
- class AsyncModel(client, *, modelId: str, label: str, modelType: str, status: str, componentName: str | None = None, source: str | None = None, lastUpdateTime: str | None = None, modelingTechnique: str | None = None, updatedBy: str | None = None)¶
Bases:
_ModelV24_2Mixin,pdstools.infinity.resources.prediction_studio.base.AsyncModelv24.2 Model business logic — defined once.
- Parameters:
- async get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: bool = False) pdstools.infinity.internal._pagination.AsyncPaginatedList[pdstools.infinity.resources.prediction_studio.base.AsyncNotification] | polars.DataFrame¶
Fetches a list of notifications for a specific model.
- Parameters:
category ({"All", "Responses", "Performance", "Model approval", "Output", "Predictors", "Prediction deployment", "Generic"} or None, optional) – The category of notifications to retrieve. If not specified, all notifications are fetched.
return_df (bool, default False) – If True, returns the notifications as a DataFrame. Otherwise, returns a list.
- Returns:
A list of notifications or a DataFrame containing the notifications.
- Return type:
AsyncPaginatedList[AsyncNotification] or polars.DataFrame
- class Model(client, *, modelId: str, label: str, modelType: str, status: str, componentName: str | None = None, source: str | None = None, lastUpdateTime: str | None = None, modelingTechnique: str | None = None, updatedBy: str | None = None)¶
Bases:
_ModelV24_2Mixin,pdstools.infinity.resources.prediction_studio.base.Modelv24.2 Model business logic — defined once.
- Parameters:
- get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: Literal[False] = False) pdstools.infinity.internal._pagination.PaginatedList[pdstools.infinity.resources.prediction_studio.base.Notification]¶
- get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: Literal[True] = True) polars.DataFrame
Fetches a list of notifications for a specific model.
This function retrieves notifications related to a model. You can filter these notifications by their category. Optionally, the notifications can be returned as a DataFrame for easier analysis and visualization.
- Parameters:
category ({"All", "Responses", "Performance", "Model approval", "Output", "Predictors", "Prediction deployment", "Generic"} or None, optional) – The category of notifications to retrieve. If not specified, all notifications are fetched.
return_df (bool, default False) – If True, returns the notifications as a DataFrame. Otherwise, returns a list.
- Returns:
A list of notifications or a DataFrame containing the notifications, depending on the value of return_df.
- Return type:
PaginatedList[Notification] or polars.DataFrame
- class AsyncPrediction(client, *, predictionId: str, label: str, status: str, lastUpdateTime: str, objective: str | None = None, subject: str | None = None)¶
Bases:
_PredictionV24_2Mixin,pdstools.infinity.resources.prediction_studio.v24_1.prediction.AsyncPredictionAsync variant of the v24.2 Prediction.
- Parameters:
- async get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: bool = False) pdstools.infinity.internal._pagination.AsyncPaginatedList[pdstools.infinity.resources.prediction_studio.base.AsyncNotification] | polars.DataFrame¶
Fetches a list of notifications for a specific prediction.
- Parameters:
category ({"All", "Responses", "Performance", "Model approval", "Output", "Predictors", "Prediction deployment", "Generic"} or None) – The category of notifications to retrieve.
return_df (bool, default False) – If True, returns the notifications as a DataFrame.
- Returns:
A list of notifications or a DataFrame.
- Return type:
AsyncPaginatedList[AsyncNotification] or polars.DataFrame
- async get_champion_challengers()¶
Fetches list of ChampionChallenger objects linked to the prediction.
- Returns:
Champion-challenger pairs from a prediction.
- Return type:
- async add_conditional_model(new_model, category: str, context: str | None = None)¶
Incorporates a new model into a prediction for a specified category and context.
- Parameters:
new_model (str or AsyncModel) – Identifier of the model to be added.
category (str) – The category under which the model will be classified.
context (str, optional) – The specific context or scenario.
- Returns:
An object detailing the updated configuration.
- Return type:
- class Prediction(client, *, predictionId: str, label: str, status: str, lastUpdateTime: str, objective: str | None = None, subject: str | None = None)¶
Bases:
_PredictionV24_2Mixin,pdstools.infinity.resources.prediction_studio.v24_1.prediction.PredictionThe
Predictionclass provide functionality including retrieving notifications, models, adding conditional models, getting champion challengers, metrics, and plotting metrics.- Parameters:
- get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: Literal[False] = False) pdstools.infinity.internal._pagination.PaginatedList[pdstools.infinity.resources.prediction_studio.base.Notification]¶
- get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: Literal[True] = True) polars.DataFrame
Fetches a list of notifications for a specific prediction.
This function retrieves notifications related to a prediction. You can filter these notifications by their category. Optionally, the notifications can be returned as a DataFrame for easier analysis and visualization.
- Parameters:
category ({"All", "Responses", "Performance", "Model approval", "Output", "Predictors", "Prediction deployment", "Generic"} or None) – The category of notifications to retrieve. If not specified, all notifications are fetched.
return_df (bool, default False) – If True, returns the notifications as a DataFrame. Otherwise, returns a list.
- Returns:
A list of notifications or a DataFrame containing the notifications, depending on the value of
return_df.- Return type:
PaginatedList[Notification] or polars.DataFrame
- get_champion_challengers()¶
Fetches list of ChampionChallenger objects linked to the prediction.
This function fetches Champion-challenger pairs from a prediction. In cases where a challenger model is absent, it returns a ChampionChallenger object containing only the champion model.
- Returns:
A list of entries, each pairing a primary model with its challenger across various segments of the prediction.
- Return type:
- class AsyncPredictionStudio(client: pdstools.infinity.internal._base_client.AsyncAPIClient)¶
Bases:
_PredictionStudioV24_2Mixin,pdstools.infinity.resources.prediction_studio.v24_1.AsyncPredictionStudiov24.2 PredictionStudio business logic — shared parts.
- Parameters:
client (pdstools.infinity.internal._base_client.AsyncAPIClient)
- async repository() pdstools.infinity.resources.prediction_studio.v24_2.repository.AsyncRepository¶
Gets information about the repository from Prediction Studio.
- Returns:
A simple object with the repository’s details.
- Return type:
- async list_models(return_df: bool = False) pdstools.infinity.internal._pagination.AsyncPaginatedList[pdstools.infinity.resources.prediction_studio.v24_2.model.AsyncModel] | polars.DataFrame¶
Fetches a list of all models from Prediction Studio.
- Parameters:
return_df (bool, optional) – Set to True to get the results as a DataFrame.
- Return type:
AsyncPaginatedList[AsyncModel] or polars.DataFrame
- async list_predictions(return_df: bool = False) pdstools.infinity.internal._pagination.AsyncPaginatedList[pdstools.infinity.resources.prediction_studio.v24_2.prediction.AsyncPrediction] | polars.DataFrame¶
Fetches a list of all predictions from Prediction Studio.
- Parameters:
return_df (bool, optional) – Set to True to get the results as a DataFrame.
- Return type:
AsyncPaginatedList[AsyncPrediction] or polars.DataFrame
- async get_prediction(prediction_id: str | None = None, label: str | None = None, **kwargs) pdstools.infinity.resources.prediction_studio.v24_2.prediction.AsyncPrediction¶
Finds and returns a specific prediction from Prediction Studio.
- Parameters:
- Return type:
- async get_model(model_id: str | None = None, label: str | None = None, **kwargs) pdstools.infinity.resources.prediction_studio.v24_2.model.AsyncModel¶
Finds and returns a specific model from Prediction Studio.
- Parameters:
- Return type:
- async trigger_datamart_export() pdstools.infinity.resources.prediction_studio.v24_2.datamart_export.AsyncDatamartExport¶
Initiates an export of model data to the Repository.
- Returns:
An object with information about the data export process.
- Return type:
- async get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: bool = False) pdstools.infinity.internal._pagination.AsyncPaginatedList[pdstools.infinity.resources.prediction_studio.base.AsyncNotification] | polars.DataFrame¶
Fetches a list of notifications from Prediction Studio.
- Parameters:
category ({"All", "Responses", "Performance", "Model approval", "Output", "Predictors", "Prediction deployment", "Generic"} or None, optional) – The category of notifications to retrieve.
return_df (bool, default False) – If True, returns as a DataFrame.
- Return type:
AsyncPaginatedList[AsyncNotification] or polars.DataFrame
- class PredictionStudio(client: pdstools.infinity.internal._base_client.SyncAPIClient)¶
Bases:
_PredictionStudioV24_2Mixin,pdstools.infinity.resources.prediction_studio.v24_1.PredictionStudiov24.2 PredictionStudio business logic — shared parts.
- Parameters:
client (pdstools.infinity.internal._base_client.SyncAPIClient)
- repository() pdstools.infinity.resources.prediction_studio.v24_2.repository.Repository¶
Gets information about the repository from Prediction Studio.
- Returns:
A simple object with the repository’s details, ready to use.
- Return type:
- list_models(return_df: Literal[False] = False) pdstools.infinity.internal._pagination.PaginatedList[pdstools.infinity.resources.prediction_studio.v24_2.model.Model]¶
- list_models(return_df: Literal[True]) polars.DataFrame
Fetches a list of all models from Prediction Studio.
- Parameters:
return_df (bool, optional) – Set to True to get the results as a DataFrame. By default False.
- Returns:
Returns a list of models or a DataFrame with model information.
- Return type:
PaginatedList[Model] or polars.DataFrame
- list_predictions(return_df: Literal[False] = False) pdstools.infinity.internal._pagination.PaginatedList[pdstools.infinity.resources.prediction_studio.v24_2.prediction.Prediction]¶
- list_predictions(return_df: Literal[True]) polars.DataFrame
Fetches a list of all predictions from Prediction Studio.
- Parameters:
return_df (bool, optional) – Set to True to get the results as a DataFrame. By default False.
- Returns:
Returns a list of predictions or a DataFrame.
- Return type:
PaginatedList[Prediction] or polars.DataFrame
- get_prediction(prediction_id: str | None = None, label: str | None = None, **kwargs) pdstools.infinity.resources.prediction_studio.v24_2.prediction.Prediction¶
Finds and returns a specific prediction from Prediction Studio.
- Parameters:
- Returns:
The prediction that matches your search criteria.
- Return type:
- Raises:
ValueError – If you don’t provide an ID or label.
- get_model(model_id: str | None = None, label: str | None = None, **kwargs) pdstools.infinity.resources.prediction_studio.v24_2.model.Model¶
Finds and returns a specific model from Prediction Studio.
- Parameters:
- Returns:
The model that matches your search.
- Return type:
- Raises:
ValueError – If you don’t provide an ID or label.
- trigger_datamart_export() pdstools.infinity.resources.prediction_studio.v24_2.datamart_export.DatamartExport¶
Initiates an export of model data to the Repository.
- Returns:
An object with information about the data export process.
- Return type:
- get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: Literal[False] = False) pdstools.infinity.internal._pagination.PaginatedList[pdstools.infinity.resources.prediction_studio.base.Notification]¶
- get_notifications(category: pdstools.infinity.resources.prediction_studio.types.NotificationCategory | None = None, return_df: Literal[True] = True) polars.DataFrame
Fetches a list of notifications from Prediction Studio.
- Parameters:
category ({"All", "Responses", "Performance", "Model approval", "Output", "Predictors", "Prediction deployment", "Generic"} or None, optional) – The category of notifications to retrieve.
return_df (bool, default False) – If True, returns the notifications as a DataFrame.
- Returns:
A list of notifications or a DataFrame.
- Return type:
PaginatedList[Notification] or polars.DataFrame
- class AsyncRepository(client, type, repository_name, bucket_name, root_path, datamart_export_location)¶
Bases:
_RepositoryV24_2Mixin,pdstools.infinity.resources.prediction_studio.v24_1.repository.AsyncRepositoryv24.2 Repository data — defined once.
- class Repository(client, type, repository_name, bucket_name, root_path, datamart_export_location)¶
Bases:
_RepositoryV24_2Mixin,pdstools.infinity.resources.prediction_studio.v24_1.Repositoryv24.2 Repository data — defined once.