AI-Based Predictive System for Cattle Pricing

TL;DR:Developed a predictive system for cattle market prices, helping secure fair prices with weekly retraining and a live dashboard to monitor prices and predictions. This is a project for 'Lonja de Binéfar', a cattle market in Spain.
The project made for Lonja de Binéfar is about developing a system that:
- Analyze the spanish cattle prices
- Create a predictive model to forecast the prices of the next week
- Create a dashboard to monitor the prices and the predictions
- Create a system of users where each user can see his own prices and predictions, incuding a dashboard with an analytics of the opinions
Link to an article about the project: Noticia Heraldo Aragón.
Technologies
Challenges
Building a reliable price prediction system for cattle markets is no small feat. The project came with a unique set of constraints that ruled out most off-the-shelf solutions:
- Scarce data (around 700 data points): With such a limited dataset, any model prone to overfitting was a non-starter.
- Highly autocorrelated prices: Sequential dependencies in the data made it hard to isolate meaningful signals from noise.
- 64 distinct cattle categories: Each combination of sex, fat grade, and weight class carries its own pricing dynamics, demanding 64 individual models.
- A web of external influences: Prices respond to weather, feed costs, demand fluctuations, and geopolitical shifts (factors that are notoriously difficult to quantify, let alone model).
Solutions
These constraints pointed clearly toward simplicity. Complex neural networks (despite testing several different architectures) consistently overfitted the data, producing large spikes whenever the trend shifted. The solution had to be lightweight, fast to train across all 64 models, and robust under uncertainty.
The chosen approach: Bayesian Ridge Regression. This linear model applies Bayes’ theorem to estimate a full probability distribution over its coefficients (rather than a single point estimate). The result is a model that is both interpretable and honest about what it doesn’t know, which turned out to be a key feature for a client making high-stakes pricing decisions.
Prices alone, however, weren’t enough. Cattle prices are shaped by the push and pull between consumers (who drive prices
down) and producers (who push them up). By incorporating market sentiment from week t + 1 as an input feature, the
model gains a forward-looking signal that meaningfully improves prediction accuracy.
On top of that, the model is retrained every week with the latest data, keeping it in sync with the ever-shifting patterns of a highly autocorrelated market.
Results
The system is live and actively used by the client, giving them a data-driven edge in price negotiations. Through an intuitive dashboard they can monitor real-time prices alongside model predictions, while a role-based user system surfaces personalized forecasts and a detailed analytics view of market opinions.

Figure 1. The dashboard displaying real prices, predicted prices, and the prevailing market opinion from Binefar.
As the chart shows, predicted prices track real prices quite closely. Beyond the current week, the system also generates 4-week-ahead forecasts expressed as probability estimates (the likelihood that prices will rise, fall, or hold steady). This gives the client a clearer picture of where the market is heading and the confidence to act on it.