Making Predictions with Machine Learning Models
Overview​
Once you've deployed a model in Abacus.AI, you're ready to start making predictions.
What You'll Learn​
In this guide, you will learn:
- What Batch Predictions are
- How to create a Batch Prediction and build a production pipeline
Batch Predictions​
There are two ways to use a deployed model:
- Call the API directly
- Use Batch Predictions
A Batch Prediction uses a deployed model (offline or online) to generate predictions on a batch of input data. This approach is ideal for use cases where real-time predictions aren't necessary—such as when you need predictions daily, weekly, or hourly.
Key principle: Your input data must match the structure of your training data.
Example Scenario​
Consider a model trained to predict house prices using this training data:
| bedrooms | bathrooms | sq_ft | year_built | location | price |
|---|---|---|---|---|---|
| 3 | 2 | 1850 | 2005 | Suburban | 425000 |
| 4 | 3.5 | 2650 | 2018 | Urban | 785000 |
| 2 | 1 | 950 | 1978 | Rural | 215000 |
| 5 | 4 | 3400 | 2021 | Suburban | 920000 |
| 3 | 2.5 | 2100 | 2012 | Urban | 615000 |
Your prediction input data should contain the same features (excluding the target variable):
| bedrooms | bathrooms | sq_ft | year_built | location |
|---|---|---|---|---|
| 3 | 3 | 1600 | 2005 | Suburban |
| 2 | 6.5 | 2650 | 2018 | Urban |
| 2 | 2 | 900 | 1978 | Rural |
| 3 | 3 | 3000 | 2021 | Suburban |
| 3 | 1.5 | 2000 | 2012 | Urban |
Creating a Batch Prediction​
Batch Predictions are how you generate predictions from all Machine Learning Models. The process applies to all project types:
- Upload your data in the same format as your model training data
- Navigate to Batch Predictions → Create New Batch Prediction from the left panel
- Follow the wizard:
- Select the deployment (the model that will generate predictions)
- Select the input Feature Group for the batch prediction
- Select the output Feature Group where predictions will be stored
Two prediction modes:
-
Predict on Test: For models trained with ground truth data, this generates out-of-sample predictions using the training dataset. No input Feature Group is needed—the training Feature Group is used automatically.
-
Predict on Future: Requires a new input Feature Group for making predictions on unseen data.
Important considerations:
- Changing your deployment version and re-running the batch prediction will generate new predictions in a new Feature Group version
- You can re-run batch predictions indefinitely to get fresh predictions
- If you refresh the underlying data of the input feature group, you can get another set of predictions based on the updated data.
So in essence, a Batch Prediction can be re-used multiple times.
Creating a Production Pipeline with a Batch Prediction​
Batch Predictions automatically use the latest Feature Group version, enabling you to refresh input data on a schedule and automatically generate updated predictions.
Example Production Workflow:​
- Set up a Connector to your database
- Load data on a scheduled cron job (e.g., weekly)
- Batch Prediction re-runs with new data based on a schedule cron job
- Export predictions back to your database on a schedule cron job. See this guide for details
Instead of managing individual cron jobs for each component (Dataset, Batch Prediction, Feature Group export), you can use a pipeline to orchestrate the entire workflow.
Abacus.AI offers many built-in pipeline templates to get you started quickly.