Prediction

class previsionio.prediction.DeploymentPrediction(_id: str, project_id: str, deployment_id: str, state='running', main_model_id=None, challenger_model_id=None, **kwargs)

Bases: previsionio.api_resource.ApiResource

A prediction object that represents a deployed experiment bulk prediction resource which can be explored on the Prevision.io platform.

classmethod from_id(_id: str) → previsionio.prediction.DeploymentPrediction

Get a prediction from the platform by its unique id.

Parameters:_id (str) – Unique id of the deployed experiment bulk prediction to retrieve
Returns:The fetched prediction
Return type:DeploymentPrediction
Raises:PrevisionException – Any error while fetching data from the platform or parsing result
get_challenger_result()

Get the prediction result of the challenger model.

Returns:Prediction results dataframe
Return type:pd.DataFrame
Raises:PrevisionException – Any error while fetching data from the platform or parsing result
get_result()

Get the prediction result of the main model.

Returns:Prediction results dataframe
Return type:pd.DataFrame
Raises:PrevisionException – Any error while fetching data from the platform or parsing result
class previsionio.prediction.ValidationPrediction(_id: str, experiment_id: str, experiment_version_id: str, project_id: str, state='running', model_id=None, model_name=None, dataset_id=None, download_available=False, score=None, duration=None, predictions_count=None, **kwargs)

Bases: previsionio.api_resource.ApiResource

A prediction object that represents an experiment bulk prediction resource which can be explored on the Prevision.io platform.

delete()

Delete a prediction from the platform by its unique id.

Raises:
  • PrevisionException – If the prediction images does not exist
  • requests.exceptions.ConnectionError – Error processing the request
classmethod from_id(_id: str) → previsionio.prediction.ValidationPrediction

Get a prediction from the platform by its unique id.

Parameters:_id (str) – Unique id of the experiment bulk prediction to retrieve
Returns:The fetched prediction
Return type:ValidationPrediction
Raises:PrevisionException – Any error while fetching data from the platform or parsing result
get_result()

Get the prediction result.

Returns:Prediction results dataframe
Return type:pd.DataFrame
Raises:PrevisionException – Any error while fetching data from the platform or parsing result