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.
Glossary
Feature Engineering

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Master the core techniques for transforming raw logistics data into powerful predictive signals. These concepts are essential for building accurate lead time and demand forecasting models.
Rolling Window Statistics
A foundational technique that computes aggregate metrics over a moving time window to capture local trends and smooth out noise.
- Rolling Mean: Calculates the average transit time over the last 7, 14, or 30 days to establish a dynamic baseline.
- Rolling Standard Deviation: Measures recent lead time variability to quantify supplier inconsistency.
- Exponentially Weighted Moving Average (EWMA): Applies higher weights to recent observations, making the feature more responsive to sudden shifts in performance.
Example: A 14-day rolling average of port dwell times can signal emerging congestion before it becomes a systemic delay.
Lag Features
Creates input variables by shifting a time series backward by a specific number of periods, allowing a model to learn from past values.
- Autocorrelation Analysis: Use partial autocorrelation function (PACF) plots to identify statistically significant lags.
- Seasonal Lags: Capture weekly or monthly patterns by creating features lagged by 7 or 30 days.
- Cross-Correlation: Lag features from an external variable, such as shifting fuel prices by 3 days to predict carrier availability.
Example: A model predicting tomorrow's delivery time might use transit_time_lag_1 (yesterday's time) and transit_time_lag_7 (last week's time) as inputs.
Date-Time Decomposition
Extracts categorical and cyclical components from timestamps to help models learn recurring temporal patterns.
- Categorical Features: Isolate
day_of_week,month,quarter, andis_weekendto capture discrete behavioral shifts. - Cyclical Encoding: Transform
hourandday_of_yearinto sine and cosine coordinates to preserve their circular nature (e.g., 23:00 is close to 00:00). - Holiday Proximity: Create a feature counting days until or since a major holiday to model demand surges and carrier capacity crunches.
Example: A sin_day_of_year and cos_day_of_year pair allows a model to understand that December and January are seasonally adjacent.
Supplier-Carrier Interaction Terms
Engineers composite features by combining two or more categorical or numerical variables to capture non-linear, synergistic effects.
- Pairwise Combinations: Multiply
supplier_lead_time_avgbycarrier_reliability_scoreto create a risk-weighted lead time signal. - Grouped Aggregations: Calculate the average On-Time In-Full (OTIF) rate for a specific
supplier_idandorigin_portpair. - Ratio Features: Compute the ratio of
actual_transit_timetocontracted_transit_timeto create a normalized performance index.
Example: A feature like avg_delay_for_supplier_on_route isolates a specific vendor's chronic performance issue on a particular lane.
Target Encoding for High-Cardinality Data
Replaces categorical variables with a numeric value derived from the target variable, handling features like supplier_id that have thousands of unique levels.
- Mean Encoding: Replace each supplier with the historical mean of their actual lead time.
- Weight of Evidence (WoE): Calculate the log-odds of a late delivery for each category, commonly used in risk modeling.
- Smoothing & Cross-Validation: Apply additive smoothing to prevent overfitting on rare categories and use out-of-fold means to avoid data leakage.
Example: Instead of a one-hot encoded vector for 10,000 suppliers, use a single numeric column representing each supplier's average historical delay.
Event-Driven Disruption Flags
Creates binary or distance-based features that signal the occurrence and proximity of external shocks to a shipment's path.
- Binary Flags: A
1if a geopolitical event, natural disaster, or labor strike is active on the shipment date,0otherwise. - Geospatial Proximity: Calculate the Haversine distance between a shipment's planned route and an active disruption zone.
- Temporal Decay: Model the lingering effect of a disruption by creating a feature that decays exponentially from the event's end date.
Example: A port_congestion_flag feature activates when the vessel queue at the destination port exceeds the 90th historical percentile.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us