pdstools.infinity.resources.prediction_studio.v24_2

Submodules

Classes

AsyncPredictionStudio

Helper class that provides a standard way to create an ABC using

PredictionStudio

Helper class that provides a standard way to create an ABC using

Repository

Helper class that provides a standard way to create an ABC using

Package Contents

class AsyncPredictionStudio(client: pdstools.infinity.client.AsyncAPIClient)

Bases: pdstools.infinity.resources.prediction_studio.v24_1.AsyncPredictionStudio

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:

client (pdstools.infinity.client.AsyncAPIClient)

version: str = '24.2'
class PredictionStudio(client: pdstools.infinity.client.SyncAPIClient)

Bases: pdstools.infinity.resources.prediction_studio.v24_1.PredictionStudio

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:

client (pdstools.infinity.client.SyncAPIClient)

version: str = '24.2'
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:

Repository

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.

This function gets information about all the models stored in Prediction Studio.

Parameters:

return_df (bool, optional) – Set to True to get the results as a DataFrame. By default, it’s False, and you get a PaginatedList.

Returns:

Returns a list of models or a DataFrame with model information, based on the return_df parameter.

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.

This function gets information about all the predictions stored in Prediction Studio.

Parameters:

return_df (bool, optional) – Set to True to get the results as a DataFrame. By default, it’s False, and you get a list.

Returns:

Returns a list of models or a DataFrame with model information, based on the as_df parameter.

Return type:

PaginatedList[Model] or polar.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.

This function looks for a prediction using its ID or label. You can also use other details to narrow down the search. It’s useful when you need to get information about one particular prediction.

Parameters:
  • id (str, optional) – The unique ID of the prediction you’re looking for. By default, it’s None.

  • label (str, optional) – The label of the prediction you’re interested in. Also None by default.

  • **kwargs (dict, optional) – Other details you can specify to help find the prediction.

  • prediction_id (Optional[str])

Returns:

The prediction that matches your search criteria.

Return type:

Prediction

Raises:

ValueError – If you don’t provide an ID or label, it will tell you that you need at least one of them.

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.

This function searches for a model using its ID or label. You can also use other details to help find exactly what you’re looking for. It’s handy when you need details about a particular model.

Parameters:
  • id (str, optional) – The unique ID of the model you want to find.

  • label (str, optional) – The label of the model you’re interested in.

  • **kwargs (dict, optional) – Other details you can specify to help find the model.

  • model_id (Optional[str])

Returns:

The model that matches your search.

Return type:

Model

Raises:

ValueError – If you don’t provide an ID or label, it will tell you that you need at least one of them.

trigger_datamart_export() pdstools.infinity.resources.prediction_studio.v24_2.datamart_export.DatamartExport

Initiates an export of model data to the Repository.

This function begins the process of moving model data from Prediction Studio to the Repository.

Returns:

An object with information about the data export process.

Return type:

DataMartExport

upload_model(model: pdstools.infinity.resources.prediction_studio.base.LocalModel, file_name: str) pdstools.infinity.resources.prediction_studio.v24_2.model_upload.UploadedModel

Uploads a model to the repository.

This function handles the uploading of a model to the Repository, creating an UploadedModel object for further MLops processes.

Parameters:
  • model (str or ONNX model object) – The model to be uploaded. This can be specified either as a file path (str) to the model file or as an ONNX model object.

  • file_name (str) – The name of the file (including extension) to be uploaded to the repository.

Returns:

Details about the uploaded model, including API response data.

Return type:

UploadedModel

Raises:
  • ValueError – Raised if an attempt is made to upload an ONNX model without the required conversion library.

  • ModelValidationError – If the model validation fails.

get_model_categories()

Gets a list of model categories from Prediction Studio.

This function gives you back a list where each item tells you about one type of model. Which can be useful for adding a condional model to a prediction.

Returns:

Each dictionary in the list has details about a model category, like its name and other useful information.

Return type:

list of dict

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.

This function retrieves notifications from Prediction Studio. 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 Repository(client, type, repository_name, bucket_name, root_path, datamart_export_location)

Bases: pdstools.infinity.resources.prediction_studio.v24_1.Repository

Helper class that provides a standard way to create an ABC using inheritance.

type
bucket_name
root_path
datamart_export_location
property s3_url