Integrate model into your Apps with Personas

With the Obviously AI Personas you can make predictions on individual entities or a single customer.

Let us consider the case study of Predicting the Customer Churn. You have a historic dataset on customers and you have used Obviously AI to train a machine Learning model.Let's say you have a new customer Jim who have registered for your service today and you want to predict whether Jim is likely to Churn or not.


Curl and Python Implementation

Curl

curl https://api.obviously.ai/user/persona
-H 'Authorization: ApiKey <api_key>'
-d '{
  "features": {
    "<column_A>": value_A,
    "<column_B>": value_B,
    "<column_C>": value_C,
    "<column_D>": value_C,
    "<column_E>": value_E,
    "<column_F>": value_F,
  },
  "id": "<report_id>"
}'

Python

import requests

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

data = {
  "features" : {
    "<column_A>": value_A,
    "<column_B>": value_B,
    "<column_C>": value_C,
    "<column_D>": value_C,
    "<column_E>": value_E,
    "<column_F>": value_F,
  },
  "id": "<report_id>"
}

response = requests.post(
  'https://api.obviously.ai/user/persona', 
  json=data, 
  headers=head
)

response.json()

In the endpoints above the columns_A, column_B, ... represent the columns that were used for prediction and the value_A, value_B, ... represent their corresponding values.
Enter your api_key and report_id. Finally replace 'column_A' , 'Column_B',... with the features that were used in the Telecom Churn Data like Total Charges, Monthly Charges, Age, Education etc and value_A, value_B,... with the corresponding values of these columns. This will return a JSON object containing the predicted Churn Probabilities of Each customer.

{
  "probabilities": {
    "No": 0.23,
    "Maybe": 0.34,
    "Yes": 0.43,
  }
}

From the above result it can be inferred that our customer Jim has 43% probability of Churning.