Inferensys

Glossary

Feature Engineering

The process of using domain knowledge to create new input variables from raw logistics data—such as rolling averages of transit times—to improve the predictive power of machine learning models.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
PREDICTIVE MODEL INPUT DESIGN

What is Feature Engineering?

Feature engineering is the systematic process of transforming raw logistics data into informative input variables that enhance the predictive accuracy of machine learning models.

Feature engineering is the domain-driven process of creating new input variables—such as rolling averages of transit times, supplier delay ratios, or seasonal lag indicators—from raw operational data to amplify the signal for predictive algorithms. It translates tacit supply chain expertise into mathematical representations that models can learn from, directly bridging the gap between raw ERP timestamps and actionable lead time forecasts.

Effective feature engineering for logistics involves constructing temporal aggregates (e.g., 7-day mean port dwell time), interaction features (e.g., carrier-distance cross-products), and risk encodings (e.g., geopolitical exposure scores). This practice is critical because the quality of input features, more than model selection, determines the ceiling of predictive performance in dynamic environments like global shipping.

PREDICTIVE LEAD TIME ANALYTICS

Core Feature Engineering Techniques

Feature engineering transforms raw logistics data into powerful predictive signals. These techniques extract temporal patterns, supplier behaviors, and operational context to dramatically improve lead time forecasting accuracy.

01

Rolling Window Aggregations

Compute statistical summaries over trailing time windows to capture recent supplier performance trends.

  • Rolling Mean Transit Time: 7-day, 30-day, and 90-day averages of actual delivery durations
  • Rolling Standard Deviation: Measures recent lead time variability for safety stock calculations
  • Exponentially Weighted Moving Average (EWMA): Applies higher weight to recent observations, making the feature responsive to sudden shifts

Example: A 30-day rolling mean of 12.3 days vs. a 7-day rolling mean of 18.7 days signals rapid supplier deterioration.

02

Lag Features and Temporal Shifts

Create features from past values of the target variable or related time series to capture autocorrelation patterns.

  • Lag-1 Lead Time: The delivery duration of the immediately preceding order from the same supplier
  • Lag-7 Seasonality: Lead time from 7 days prior to capture day-of-week effects
  • Difference Features: Change in lead time between consecutive orders (lag-1 minus lag-2)

Critical for: Capturing momentum — if the last three shipments were late, the next one likely will be too.

03

Supplier Behavioral Profiling

Engineer features that encode historical supplier reliability patterns as static or slowly-changing covariates.

  • On-Time In-Full (OTIF) Rate: Percentage of orders delivered complete and on schedule over the past quarter
  • Mean Absolute Deviation (MAD): Average absolute difference between promised and actual delivery dates
  • Bias Indicator: Signed metric showing whether a supplier systematically over-promises (negative bias) or under-promises (positive bias)
  • Response Time Percentile: How quickly a supplier acknowledges purchase orders relative to peers

These features enable the model to learn supplier-specific correction factors.

04

Calendar and Event Encoding

Transform temporal metadata into features that capture cyclical patterns and known disruptions.

  • Cyclical Encoding: Map day-of-week and month-of-year onto a unit circle using sine/cosine transforms to preserve periodicity
  • Holiday Proximity: Days until or since major regional holidays (Chinese New Year, Golden Week, Christmas)
  • Fiscal Period Flags: Binary indicators for month-end, quarter-end, and year-end shipping surges
  • Business Day Counter: Number of actual working days between order and expected delivery, excluding weekends and holidays

Example: Lead times spike 300% during the week before Chinese New Year due to factory shutdowns.

05

Interaction and Cross Features

Combine multiple raw variables to capture non-linear relationships that individual features miss.

  • Distance × Carrier Type: Interaction term capturing that air freight speed advantage grows with distance
  • Order Quantity ÷ Supplier Capacity: Ratio indicating supplier utilization pressure
  • Season × Port: Categorical cross capturing that specific ports have unique seasonal congestion profiles
  • Product Category × Origin Country: Encodes regulatory and customs complexity

Technique: Use feature crosses in gradient boosting models or explicit interaction terms in linear models to expose multiplicative effects.

06

Target Encoding for High-Cardinality Categories

Replace categorical variables with a numeric representation derived from the target variable, handling categories with many unique values.

  • Supplier-Level Mean Lead Time: Replace supplier ID with their historical average delivery duration
  • Lane-Level Variability: Encode origin-destination pairs with their standard deviation of transit time
  • Carrier Reliability Score: Map carrier ID to their OTIF percentage

Regularization: Apply smoothing (Bayesian target encoding) or cross-fold computation to prevent overfitting on rare categories. A supplier with only 3 shipments should not get an extreme encoding.

FEATURE ENGINEERING

Frequently Asked Questions

Explore the critical process of transforming raw logistics data into powerful predictive signals. These FAQs clarify how domain knowledge is encoded into machine learning models to improve lead time accuracy.

Feature engineering is the process of using domain-specific knowledge to transform raw data into informative input variables that significantly improve the predictive power of machine learning models. In the context of predictive lead time analytics, raw data such as timestamps, carrier IDs, and port codes hold latent information that standard algorithms cannot directly interpret. By creating features like rolling averages of transit times, supplier reliability scores, or lagged port congestion indicators, you explicitly encode the physics and business logic of the supply chain into the model. This process is critical because the quality of the input features defines the upper limit of model performance; a sophisticated Temporal Fusion Transformer or Gradient Boosting Machine cannot compensate for poorly constructed inputs. Effective feature engineering separates a naive forecast from a production-grade system that understands seasonal volatility, carrier-specific delays, and multi-echelon dependencies.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.