Problem
A poultry farm needs the final weight of a batch before it is sold, to save on feed and optimize production. The inputs are daily records of climate, feed, water and head count, so the forecast must be recalculated every day as new data come in. The dataset has 265,214 rows and 36 columns over almost four years, with missing values, type mismatches and impossible readings such as zero humidity.
Example from the article: The author built the model while introducing a BI system at a poultry farm for a customer. It forecasts cumulative batch weight for each growing day.
Solution in brief
The author cleans the daily table, keeps seven non-redundant features and trains XGBoost, CatBoost and a stacked ensemble on cumulative weight. Optuna tunes the hyperparameters. The tuned models have errors of 9.3–10.2% on the test set (the article does not name the exact metric), and CatBoost shows 3.4–7.1% per batch on batches that were still open.
Questions this case answers
- How to forecast the cumulative output of a production batch from daily operational readings and refresh the forecast each day
- How to compare gradient boosting variants on tabular regression and report the error relative to the mean target
- How to forecast the final weight of a poultry batch from daily farm readings?
- How to correct a production forecast every day as new feed, water and climate data arrive?
Tools and methods
- XGBoost — baseline regressor and meta-model of the stack
- CatBoost — comparison model, used for the open-batch check
- Random Forest — base model of the stacking ensemble
- Optuna — Bayesian search of hyperparameters
- scikit-learn, pandas — split, metrics, preprocessing
Google or a one-time email code. No password.
