Predict API

Once your model is trained, you must deploy the model on Abacus.AI platform to generate predictions. You can use the prediction dashboard to generate the predictions from the trained model. In this section the underlying prediction API and all other additional prediction API methods are discussed for the use case in consideration:

Method
predict POST
Copy POST

Returns a prediction for Predictive Modeling

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes deploymentToken str A deployment token used to authenticate access to created deployments. This token is only authorized to predict on deployments in this project, and is safe to embed in an application or website.
Yes deploymentId str A unique identifier for a deployment created under the project.
Yes queryData dict A dictionary where the key is the column name (e.g. a column with name 'user_id' in the dataset) mapped to the column mapping USER_ID that uniquely identifies the entity against which a prediction is performed, and the value is the unique value of the same entity.
No kwargs dict Additional usecase specific keyword arguments to be passed. Example - explain_predictions for regression models.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
Prediction

Exceptions:

TYPE WHEN
DataNotFoundError

deploymentId is not found.

Language:

Method
predictClass POST
Copy POST

Returns a classification prediction

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes deploymentToken str The deployment token to authenticate access to created deployments. This token is only authorized to predict on deployments in this project, so it is safe to embed this model within an application or website.
Yes deploymentId str The unique identifier for a deployment created under the project.
Yes queryData dict A dictionary where the 'Key' is the column name (e.g. a column with the name 'user_id' in your dataset) mapped to the column mapping USER_ID that uniquely identifies the entity against which a prediction is performed and the 'Value' is the unique value of the same entity.
No threshold float A float value that is applied on the popular class label.
No thresholdClass str The label upon which the threshold is added (binary labels only).
No thresholds dict Maps labels to thresholds (multi-label classification only). Defaults to F1 optimal threshold if computed for the given class, else uses 0.5.
No explainPredictions bool If True, returns the SHAP explanations for all input features.
No fixedFeatures list A set of input features to treat as constant for explanations - only honored when the explainer type is KERNEL_EXPLAINER
No nested str If specified generates prediction delta for each index of the specified nested feature.
No explainerType str The type of explainer to use.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
Prediction

Exceptions:

TYPE WHEN
DataNotFoundError

deploymentId is not found.

Language:

Method
predictMultiple POST
Copy POST

Returns a list of predictions for predictive modeling.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes deploymentToken str The deployment token used to authenticate access to created deployments. This token is only authorized to predict on deployments in this project, and is safe to embed in an application or website.
Yes deploymentId str The unique identifier for a deployment created under the project.
Yes queryData list A list of dictionaries, where the 'key' is the column name (e.g. a column with name 'user_id' in the dataset) mapped to the column mapping USER_ID that uniquely identifies the entity against which a prediction is performed, and the 'value' is the unique value of the same entity.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
Prediction

Exceptions:

TYPE WHEN
DataNotFoundError

deploymentId is not found.

Language:

Method
predictFromDatasets POST
Copy POST

Returns a list of predictions for Predictive Modeling.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes deploymentToken str The deployment token used to authenticate access to created deployments. This token is only authorized to predict on deployments in this project, so it is safe to embed this model inside of an application or website.
Yes deploymentId str The unique identifier for a deployment created under the project.
Yes queryData dict A dictionary where the 'key' is the source dataset name, and the 'value' is a list of records corresponding to the dataset rows.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
Prediction

Exceptions:

TYPE WHEN
DataNotFoundError

deploymentId is not found.

Language: