Real-Time Integration
Start predicting the future behavior of new players while even they do not know how to behave in the future. AppNava defines player groups who are likely to complete a specific action and conversion events. So you can engage with players before they churn; attract players who are likely to complete in-app purchases and much more. Also with AppNava, you can choose the right balance between segment size and accuracy.
After the model has been trained, there are two ways for carrying out predictions:
Dashboard
Predictions can be done directly through the dashboard by clicking on the Predict Now
button. Upon successful completion, the results will be visible in the table on the Trained Models tab as shown below.
After clicking the Predict Now
button, you will see a modal (a slight delay might occur while fetching daily users) to select the following options:
- Trained Models: A list of selectable models that you have trained.
- Prediction Selection: : The duration for the prediction that you will perform. A choice between First Session and First Day.
- User Id: A list of users that are multi-selectable and on which the predictions will be performed.
After selecting these fields, the Predict
button can be clicked to start the prediction and upon successful completion the results should be available in the table below.
Note: The Bulk Prediction
button is an experimental feature and is subject to change. Clicking this button performs predictions for all users of the day and stores the results in our database (results are not visible on the dashboard). The fields Trained Models and Prediction Selection are mandatory, while the User Id field is optional for this feature.
cURL Request
Another alternative is to send a curl request to our endpoint and recieve the results back in the form of a json response.
In order to do that, first navigate to the Predictions tab and create a prediction using the Create Prediction button
.
After clicking the button, a modal will open prompting the user to select between two options:
- API Call
- Scheduled Prediction
API Call
Choosing API Call presents two options:
- Through Firebase: Requires Firebase measurement API integration.
- Direct Response to Game: The api can be invoked directly inside the game client and the results can be collected without any
additional integration.
Choosing Direct Response to Game prompts you to fill the following fields:
- Prediction Name: A unique name for your prediction.
- Model Name: A selectable list of models that you have trained.
- Prediction Frequency: The time constraint for the prediction that you will perform i.e First Session etc
- Conversion Value: A checkbox to allow for receiving numeric values for non-numeric results for example in the case of Churn Models
- Bulk Prediction:: A checkbox to specify if the prediction should be done for all the daily users.
After clicking, Next
you will see the following modal that will contain a sample curl request that can be adjusted accordingly.
Finally, clicking the Create Prediction
button will redirect the user back to the Predictions page and create an entry on the table in that
page with the Prediction Type as API Call: Direct Access. The prediction type in the table will vary depending on what type of prediction
was selected.
For API Calls, the action tab will have a button to display the generated embed code as follows:
This curl request can be used to hit our endpoint and retrieve the results directly inside the game client or from other sources.
API Response (Successful Responses)
Classification Models
{
"success": true,
"message": "Prediction succeeded",
"data": {
"prediction_result": "churn",
"prediction_probability_for_positive_class": 0.85,
"prediction_probability_for_negative_class": 0.15,
"probability_group": "high"
}
}
Regression Models
{
"success": true,
"message": "Prediction succeeded",
"data": {
"prediction_result": 42.5,
"prediction_probability": 42.5
}
}
Notes:
- All predictions are automatically saved to BigQuery for historical tracking.
- The API supports both classification and regression models.
- A positive class probability denotes the probability of the class the model is interested in happening i.e in the case of a churn model, it
would simply be Churn and negative class would be vice versa
prediction_probability_for_tertiary_class
will be additionally sent but only for the LTV C model since it is a multi-classification
model.
prediction_result
will change depending on the model i.e churn model will give a result of either churn or not-churn, a subscriber
model will give a result of subscriber or non-subscriber.
- Probability groups for classification models are categorized as follows:
- Low: ≤ 0.39
- Mid: 0.40 - 0.60
- High: > 0.60
- As mentioned in before,
probability_group
will be either “high“, 'mid“ or “low“ and depends on the positive class. This is automatically
classed for general evaulation according to preset conditions and is an estimation. In regressor models, prediction_result
is
calculated by checking the average ltv and serves a similar purpose.
- Individual users are limited to 20 predictions
API Response (Error Responses)
The API returns different error response formats depending on the error type.
No Data Available
{
"success": false,
"error_code": "NO_DATA",
"message": "No data available for user: user123",
"user_id": "user123"
}
Too Many Predictions
{
"success": false,
"error_code": "SEEN_TOO_MANY",
"message": "User has exceeded maximum prediction limit",
"user_id": "user123"
}
No Users Found
{
"success": false,
"error_code": "NO_USERS_FOUND",
"message": "No users found matching the criteria",
"user_id": "N.A (Bulk Pred)"
}
Common Mistakes:
- Often the curl requests are not constructed properly inside the game client and hence the requests fails.
- The --data-raw option specifies the data to be sent to the endpoint as a JSON object, it should be ensured that the JSON is properly
formatted and is valid.
- Booleans should be lowercase in JSON e.g true is valid but True is not valid.
- JSON should be sent in the body of a HTTP request and should not be nested inside another body key.
Scheduled Prediction
This option allows users to schedule predictions for a specific duration that will run daily automatically. Upon clicking the option, a modal can
be seen with the following fields:
- Prediction Name: A unique name for the scheduled prediction.
- Model Name:A selectable list of models that you have trained.
- Prediction Frequency: The time constraint for the prediction that you will perform. i.e First Session etc
- Start Date: When the scheduled prediction should start.
- Schedule Date: The duration for the scheduled prediction in days i.e how long it should last?
Lastly, after clicking done, the user will be redirected to the Predictions page and prediction will be created in the table with the status
Scheduled Prediction.
Visualization of Results
Appnava offers an elegant solution for visualizing your data. All prediction made through curl requests can be visualized using the
Prediction Results tab.
The table and chart shows an accumulation of daily predictions. Depending on the models i.e Churn, LTV etc the columns will vary. The real
results are calculated depending on the model as well and can be compared to the predicted results to evalute the accuracy of the model.