Don't ask your model to learn what a formula already knows!
The formula encodes what we know. The model encodes what we cannot derive analytically.
TL;DR: If you can write a formula that gets you 70% of the way there, don't throw it away. Feed it in. This applies anywhere you have a reasonable first-principles estimate: pricing, demand-forecasting, energy-consumption, manufacturing-yield.

The Problem
In a delivery-time prediction project (ETA), I had a choice: use the simple formula, or train the model from scratch.
The formula was obvious — estimated duration from distance and rider speed. Most competitors either used that formula directly, or ignored it and let XGBoost recover the relationship from raw features.
I did neither.
The Approach
I gave the formula's output to the model as a structured prior, then let the model learn the deviation.
The formula captures
The stable physical relationship (distance → time)
The model captures
What the formula systematically misses: traffic, geography, rider variability, time-of-day effects
The model's job is no longer "predict delivery time." It becomes "predict how wrong this estimate will be, and in which direction." That's a much easier learning problem.
Key Takeaway
Design insight: If you can write a formula that gets you 70% of the way there, don't throw it away. Feed it in. This applies anywhere you have a reasonable first-principles estimate: pricing, demand-forecasting, energy-consumption, manufacturing-yield.
Related
Polars Lazy Execution: More Than a Faster pandas → Cyclical Encoding: Stop One-Hot Encoding Months →isnull() Is a Feature →Encoding Is a Modeling Decision →Necessary Conditions vs Drivers →SHAP Waterfall Local Explanation →Focal Loss for Imbalanced Classification →AI Can Review Feature Code. It Cannot Approve It →
Comments
FAQ
What is the key takeaway from "Don't ask your model to learn what a formula already knows!"?
If you can write a formula that gets you 70% of the way there, don't throw it away. Feed it in. This applies anywhere you have a reasonable first-principles estimate: pricing, demand-forecasting, energy-consumption, manufacturing-yield.
Who wrote this and what is it about?
This was written by Mahmoud Trigui, Senior Data Scientist. In delivery-time prediction, using a domain formula as a structured prior lets the model focus on learning deviations rather than rediscovering physics.