Feature engineering and preprocessing · insight-1114
Hand a boosted tree the ratio it cannot build cheaply, such as load factor or price per unit
- Evidence type
- practitioner heuristic
- Difficulty
- medium
- Roles
- Data scientist
- Industries
- aviation, retail
Summary: situation, action, reason, boundary
Situation
The target depends on a ratio, bookings over capacity or fare over distance, yet the model receives only numerator and denominator.
Action
Add the guarded ratio as a feature, compare against the parts-only model at a fixed tree and depth budget, and keep the raw parts only if they still add validation signal.
Reason
Every split compares one feature with a threshold; a ratio boundary is a line through the origin in the plane, which one split on the ratio expresses at once.
Boundary
Gradient boosting and random forests on rates, shares and unit prices.
Symptom or risk
Axis-aligned splits approximate a diagonal boundary with a staircase, costing depth and trees and giving unstable behaviour in sparse corners.
Exceptions
Large data with enough depth to approximate the boundary, or ratios whose denominators are often tiny.
Trade-offs
Ratio inputs add noise when the denominator is small and one more definition to keep in sync at serving.
Pitfalls
Adding the ratio without the guard from the zero-denominator rule and then crediting it for an apparent gain.
Example
Hypothetical: stock-out risk jumps when bookings exceed 85% of capacity on aircraft of 150 to 220 seats; one split on the ratio replaces many paired splits on bookings and capacity.