Batch Predict From File

With the Batch Predict Personas you can make predictions on a group of customers. Consider you work in a Telecom company and you have trained a machine learning model on a historic dataset to predict Customer Churn using Obviously AI . Let's say you have 30 new customers who have recently registered for your service and you want to predict the Churn Probabilities for each of these 30 customers.

Initially you need to create a CSV file for these new customers with the attributes/columns that were used for predictions.

Once you have a CSV you are all set to use the Batch Predict API to make the predictions.Simply enter the path to the CSV file Curl/Python Snippet below

Curl and Python Implementation


-H 'Authorization: ApiKey <api_key>'
-F "id=<report_id>"
-F "[email protected]<file.csv>"


import requests

head = {
    'Authorization' : 'ApiKey <api_key>'

data = {
    'id': '<report_id>'

csv_to_predict = open('<path_to_csv_file>', 'rb')
file = {
    'file': csv_to_predict

response =


This endpoint enables you to retrieve the CSV file Containing prediction output for batch request.There would be two new columns appended to the CSV file- Churn Prediction(whether the customer has cancelled his subscription or not) and the Probability of Prediction


7590-VHVEG,Female,0,Yes,No,1,No,No phone service,DSL,No,Yes,No,No,No,No,Month-to-month,Yes,Electronic check,29.85,29.85,Yes,0.593566510826916

5575-GNVDE,Male,0,No,No,34,Yes,No,DSL,Yes,No,Yes,No,No,No,One year,No,Mailed check,56.95,1889.5,No,0.952422212791426

3668-QPYBK,Male,0,No,No,2,Yes,No,DSL,Yes,Yes,No,No,No,No,Month-to-month,Yes,Mailed check,53.85,108.15,No,0.6755339861338824

7795-CFOCW,Male,0,No,No,45,No,No phone service,DSL,Yes,No,Yes,Yes,No,No,One year,No,Bank transfer (automatic),42.3,1840.75,No,0.9740466443121949

9237-HQITU,Female,0,No,No,2,Yes,No,Fiber optic,No,No,No,No,No,No,Month-to-month,Yes,Electronic check,70.7,151.65,Yes,0.6616151717922236

9305-CDSKC,Female,0,No,No,8,Yes,Yes,Fiber optic,No,No,Yes,No,Yes,Yes,Month-to-month,Yes,Electronic check,99.65,820.5,Yes,0.7776983994295306