← Back to Blog

Forecast Data Prep Guideline

Turn your business knowledge into high-accuracy AI forecasts

Purpose

High-performing ML forecasting models don’t just need clean data - they need contextual intelligence. Your domain expertise gives the model eyes and ears: it helps it understand why numbers move.

This guide explains how to add business meaning to your data so that QuantixAI can generate forecasts that are not only accurate but also explainable and actionable.

Why context matters: A machine learning algorithm can detect patterns in historical data, but without context, it cannot distinguish between a one-time promotion spike and sustainable growth, between a weather-driven anomaly and a market trend shift, or between operational constraints and declining demand. The difference between a good forecast and a great one lies in your ability to translate business knowledge into features the model can learn from.


1. The Foundation: A Clean and Continuous Timeline

Even the best business context cannot fix missing or inconsistent time structure.

Time series forecasting algorithms rely on consistent temporal patterns. Missing dates, irregular frequencies, or gaps in your data will confuse the model and lead to unreliable predictions. Think of your timeline as the foundation of a building - everything else depends on it being solid and level.

Key principles:

  • Ensure every day is present, even with zero activity. A missing row is ambiguous: Does it mean zero sales, or was data not collected? The model cannot distinguish between the two.
  • Use consistent daily frequency. If you start with daily data, maintain daily data. Don’t switch to weekly or monthly aggregation mid-stream unless you’re creating a new dataset.
  • Avoid deleting weekends or holidays. These are legitimate data points. Your business might be closed, but the pattern of “closed days” is valuable information for the model.
  • Record zeros instead of missing rows. Zero sales on a Sunday is meaningful information. A missing Sunday is noise.

Common mistakes to avoid:

  • Removing “inactive” periods from historical data
  • Starting the dataset at the first transaction rather than the first business day
  • Having different date ranges for different products or regions
  • Using inconsistent date formats across different data sources

2. Capturing the Business Calendar

QuantixAI automatically extracts temporal features like day of week, month, and seasonal patterns using Fourier terms - but it cannot know your country’s holidays or your company’s specific events.

Every business operates within its own rhythm of events, campaigns, and seasonal patterns. QuantixAI’s internal pipeline creates features for weekly and monthly cycles, but only you can tell it which specific days are holidays, shutdowns, or important business events in your market. By explicitly marking these events, you allow the model to learn their specific impact and apply that knowledge to future forecasts.

What to Include

  • Company holidays & shutdowns - e.g. annual maintenance, factory vacation, fiscal year close
  • Sales or marketing events - e.g. Back to School, Black Friday, Anniversary Sale
  • Industry events - e.g. trade fairs, exhibitions, partner summits
  • Local or regional events - festivals, sports championships, local holidays
  • Public holidays with unique impact - Christmas may affect B2C differently than B2B

Your Action Plan

TaskExampleWhy It Matters
Add a column for internal holidaysIs_Factory_Shutdown = 1The model learns downtime periods
Add event columns for key campaignsSpring_Sale = 1Prevents spikes being read as permanent growth
Add regional holiday flagsRegion_Holiday = 1Enables region-level models to adjust properly

3. Business Structure: Products, Markets, and Channels

Your data should mirror how your business actually operates.

Organizational structure isn’t just about reporting - it’s about capturing the real relationships and hierarchies in your business. Products within the same category often move together. Channels have distinct customer behaviors. Regions have unique seasonality. By encoding these structural relationships, you enable the model to learn cross-sectional patterns and make more accurate forecasts even for new or low-volume items.

DimensionExamplesWhy It Matters
Product hierarchyProduct β†’ Category β†’ DivisionCaptures cross-product relationships
Sales channelRetail, E-commerce, TelesalesEach behaves differently
Market or regionNorth, South, EastRegional seasonality & events
Customer segmentSMB, EnterpriseDifferent buying cycles
Brand or tierPremium vs EconomyDifferent elasticity & volatility

Action Plan

  • Include clear categorical columns for these dimensions.
  • Keep names consistent over time.
  • If reorganizing (e.g. merging regions), log that change as an event flag.

4. Business Drivers: The “Why” Behind the Numbers

Raw data shows what happened. You provide why it happened.

This is where domain expertise becomes most valuable. You know that a 30% sales spike in March wasn’t organic growth - it was your spring campaign combined with a competitor’s stockout. You know that the July dip wasn’t seasonal - your warehouse was being renovated. These causal drivers are the difference between a model that predicts based on correlation and one that understands causation.

TypeExamplesEffect
PromotionsDiscount_20pct, Free_ShippingShort-term uplift
Price changesPrice_Change_PctEnables elasticity learning
Marketing activityTV_Campaign, Google_Ads_ActiveLinks awareness with demand
Operational constraintsStockout, Website_Down, Logistics_DelayExplains short-term dips
Assortment changesNew_Product_Added, DiscontinuedCaptures life-cycle effects

Action Plan

  • Use binary (0/1) or numeric columns for each event.
  • For multi-channel marketing, use one column per channel.
  • Record absolute and relative price changes.
  • Flag operational issues instead of deleting them.

5. External Factors: What’s Happening Around You

Forecast accuracy often depends on external signals - things outside your control but inside your market reality.

Your business doesn’t operate in a vacuum. Market conditions, economic indicators, weather patterns, and regulatory changes all influence demand. While you can’t control these factors, you can measure them and help the model learn how they affect your business. This is especially important for medium to long-term forecasts where external trends become more significant than internal patterns.

DomainExamplesWhy It Matters
Market conditionsCompetitor prices, category demand, ad indexReflects competitive shifts
EconomyGDP, CPI, fuel price, interest rateCaptures macro trends
WeatherTemperature, rainfallCritical for beverages, retail, energy
RegulationTax changes, trade bansMarks structural breaks
Supply chainSupplier delay, strikeExplains temporary disruptions

Action Plan

  • Identify accessible external datasets.
  • Align them to your daily timeline.
  • Add as numeric columns (ratios, indexes) or binary shock flags.
  • Document their source and meaning.

6. Disturbances, Anomalies & Black Swans

Don’t erase unpredictable events - label them.

Unexpected disruptions are part of business reality. A pandemic lockdown, a factory fire, a cyberattack, or a major supplier failure can create dramatic outliers in your data. The instinct is often to remove these “outliers” to avoid biasing the model. But that’s a mistake. Instead, flag them. This teaches the model to recognize and adjust for anomalies rather than learning false patterns from them.

ExampleSuggested Feature
Power outageUnexpected_Event = 1
Pandemic lockdownLockdown_Period = 1
Logistics strikeStrike_Active = 1
System failureWebsite_Down = 1
Even if you only have a few such cases, flagging them helps QuantixAI interpret outliers correctly and prevent them from biasing trend detection.

7. Business Rules & Policy Changes

Company decisions influence customer and sales behavior.

Internal policy changes can have effects as significant as external market shifts. When you change your minimum order value, alter payment terms, or adjust pricing structures, customer behavior changes. If you don’t flag these policy changes in your data, the model might misinterpret the resulting demand shifts as market trends or seasonal patterns.

PolicyExampleWhy It Matters
Minimum Order Value (MOV)MOV_Change = 1, MOV_EUR = 100Changes buying thresholds
Payment termsTerms_Changed = 1Affects cash flow and timing
Price list updatesNew_Price_List = 1Explains price jumps
Stock allocation ruleStock_Prioritized_Region = “West”Explains divergence by region
KPI or target changesSales_Target_Adjustment = 1Explains behavioral shifts

8. Product Lifecycle & Portfolio Changes

Different products follow different life cycles - from launch to maturity to decline.

New products often show rapid growth followed by stabilization. Mature products have stable demand patterns. Declining products show gradual erosion. If you treat all products the same way, your model will struggle with new launches and phase-outs. By explicitly tracking lifecycle stage and product age, you help the model apply appropriate expectations to each product’s forecast.

Suggested Features

  • Is_New_Product = 1
  • Days_Since_Launch
  • Is_Discontinued = 1
  • Category-level product count (to show portfolio size)

9. Metadata & Documentation

A simple data dictionary helps QuantixAI and your future self understand what each column means.

Good documentation is not just best practice - it’s essential for maintaining forecast quality over time. When someone else needs to update your data, when you need to troubleshoot unexpected forecasts, or when you want to expand your feature set, clear documentation saves hours of work and prevents errors. Think of it as the user manual for your forecasting data.

Include:

  • Column name & description
  • Units & data source
  • Known anomalies or adjustments
  • Meaning of flags
  • Date range covered

We strongly recommend creating a short README or Excel sheet describing each column in plain language. While QuantixAI doesn’t currently use this metadata automatically, having this documentation is invaluable for data maintenance, troubleshooting forecasts, onboarding new team members, and ensuring consistency when updating your datasets over time.


10. The QuantixAI Checklist

Use this checklist to ensure your data is ready for high-quality forecasting. Each item represents a dimension of context that can significantly improve forecast accuracy and interpretability.

AreaKey Tasks
TimelineContinuous daily data, no missing days
StructureInclude product, region, channel, customer
CalendarFlag holidays, events, shutdowns
DriversInclude promotions, price changes, campaigns
ExternalAdd market, weather, or macro data
AnomaliesLabel unexpected or one-off events
PoliciesTrack internal rule changes
LifecycleMark launches & discontinuations
MetadataInclude column dictionary & notes

11. Future Availability: A Critical Constraint

Every feature you use for training must be available for all future periods you want to forecast.

This is one of the most important - and often overlooked - principles in forecasting. When QuantixAI generates a forecast for the next 30 days, it needs values for all your features for those 30 days. If you trained your model using daily maximum temperature, competitor prices, or Google Ads spending, you must provide these values for the entire forecast horizon.

The Challenge

Some features are easy to provide for the future:

  • Calendar features: Holidays, company shutdowns - these are known in advance (note: QuantixAI handles day of week and month automatically)
  • Planned events: Marketing campaigns, sales events, promotional periods - you control these
  • Policy changes: Pricing updates, MOV changes - you decide these

But other features are problematic:

  • Weather data: While forecasts exist, they become unreliable beyond 7-10 days
  • Competitor prices: You cannot know their future pricing decisions
  • Economic indicators: GDP, CPI, interest rates - published with delays
  • Market demand indices: Often published retrospectively
  • Actual promotional performance: You know when the promotion will run, but not its exact impact

Practical Solutions

Feature TypeProblemSolution
Weather (temperature, rainfall)Forecasts unreliable beyond 10 daysUse seasonal averages for the period, or limit forecast horizon to 7 days when weather is critical
Competitor pricesUnknown future valuesUse last known value, historical average, or remove feature entirely
Economic indicatorsPublished with lagUse official forecasts from central banks, or forward-fill last known value
Promotional impactExact effect unknownUse binary flag (promotion yes/no) instead of actual results
Stock availabilityCannot predict future stockoutsUse planned inventory levels or assume normal availability

Best Practices

  • Prefer controllable features: Focus on events and factors you can plan and control
  • Use binary flags over continuous values: “Promotion active” is better than “promotion revenue”
  • Consider forecast horizon: Short-term forecasts can use more features than long-term ones
  • Test feature availability: Before adding a feature, verify you can provide it for future periods
  • Document assumptions: Clearly note how you handle future values for each external feature
  • Use scenarios: For uncertain external factors, create multiple forecast scenarios (optimistic, realistic, pessimistic)

The Rule of Thumb

If you cannot reliably provide a feature’s future values, either don’t use it, or have a clear, documented method for estimating those values.

A model trained on rich historical data but missing critical features in the forecast period will produce unreliable predictions. It’s better to use fewer, reliably available features than to include features that create uncertainty in your forecasts.


Final Thought

Machine learning learns from what it sees - but you decide what it can see.

Your operational context isn’t “extra data.” It’s the difference between an algorithm guessing and an AI understanding your business.

The best forecasting models are built on a partnership between human expertise and machine learning. You bring the context, the domain knowledge, the understanding of why things happen. The AI brings pattern recognition, scalability, and the ability to process complex interactions across thousands of variables. Together, you create forecasts that are not just accurate, but explainable, actionable, and trusted.

Remember: Data preparation is not a one-time task. As your business evolves, so should your data context. New products launch, markets shift, policies change. Keep your feature set current, and your forecasts will remain accurate and relevant.