NeuralProphet

Advanced Time Series Forecasting with Neural Networks

Business Scenario: E-commerce Sales Forecasting

Business Question

"Can we accurately predict our online sales for the next 12 months to optimize inventory, staffing, and marketing budgets? We need a model that captures complex patterns like seasonality, trends, and special events."

Our Dataset: Monthly Sales Data

We have 3 years of monthly e-commerce sales data showing clear seasonal patterns and growth trends:

Date Monthly Sales ($) Holiday Month Marketing Spend ($)
2021-01 $125,000 No $15,000
2021-02 $118,000 No $12,000
2021-03 $135,000 No $18,000
2021-11 $285,000 Yes $45,000
2021-12 $320,000 Yes $50,000
2023-12 $425,000 Yes $65,000
Time Features (Date, Holidays, Marketing)
Target (Sales Revenue)

Understanding Time Series Data

  • Time Dependency: Each month's sales depend on previous months and seasonal patterns
  • Seasonality: Clear holiday spikes in November/December every year
  • Trend: Overall growth in sales from 2021 to 2023
  • External Factors: Marketing spend and holidays influence sales
  • Goal: Predict future sales to optimize business operations

What is NeuralProphet?

NeuralProphet is an advanced time series forecasting library that combines traditional time series analysis with neural networks. It's designed to capture complex patterns in sequential data and make accurate future predictions.

Think of it Like This

  • Weather Prediction: Like meteorologists use past weather patterns to forecast future weather
  • Memory + Learning: Remembers historical patterns and learns complex relationships
  • Multiple Patterns: Captures daily, weekly, monthly, and yearly cycles simultaneously
  • Uncertainty: Provides confidence intervals, not just point predictions

Trend

Long-term growth or decline in the data

Seasonality

Repeating patterns (daily, weekly, yearly)

Autoregression

How past values influence future values

External Factors

Holiday effects, marketing campaigns, events

Advantages of NeuralProphet

  • Handles complex non-linear patterns
  • Automatic seasonality detection
  • Incorporates external variables
  • Provides uncertainty quantification
  • Scalable to large datasets
  • Built-in change point detection

When NeuralProphet Excels

  • Business forecasting (sales, demand)
  • Strong seasonal patterns
  • Multiple time series
  • Need uncertainty estimates
  • Complex trend changes
  • External factor effects

Interactive Forecasting Demo

Watch how NeuralProphet analyzes historical sales data and creates future predictions with confidence intervals:

Forecast Horizon: 12 months How far into the future to predict
Historical Sales
Trend Component
Seasonal Pattern
Future Predictions
Uncertainty Band

How NeuralProphet Works

1. Data Preparation

Organize time series data with timestamps and handle missing values

2. Trend Modeling

Fit flexible trend curves that can change over time with detected change points

3. Seasonality Detection

Automatically identify and model repeating patterns at different time scales

4. Autoregression

Use neural networks to learn how past values influence future predictions

5. External Factors

Incorporate holidays, marketing campaigns, and other external variables

6. Neural Network Training

Train deep learning models to combine all components optimally

Key Components Explained

  • Additive Model: y(t) = trend(t) + seasonality(t) + autoregression(t) + holidays(t) + noise
  • Change Points: Automatically detect when trends shift (like market changes)
  • Fourier Series: Mathematical representation of seasonal patterns
  • AR-Net: Neural network component for autoregressive relationships
  • Lagged Features: Use past values as inputs to predict future values

Traditional vs Neural Approach

  • Traditional (ARIMA): Linear relationships, manual tuning
  • Prophet: Additive model, good seasonality handling
  • NeuralProphet: Non-linear patterns + automatic optimization
  • Advantage: Best of both worlds - interpretability + flexibility

Uncertainty Quantification

  • Point Predictions: Single best guess for future values
  • Confidence Intervals: Range of likely outcomes
  • Quantile Regression: Predict different percentiles
  • Business Value: Risk assessment and scenario planning

Model Performance Evaluation

Let's evaluate how well our NeuralProphet model performs on the e-commerce sales forecasting task:

Mean Absolute Error

$8,500

Average prediction error in monthly sales

MAPE

4.2%

Mean Absolute Percentage Error - relative accuracy

R-squared

94%

Variance in sales explained by the model

Coverage

92%

Actual values within predicted confidence intervals

What These Results Mean for Business

  • Low MAE ($8,500): Predictions are typically within $8,500 of actual sales
  • Excellent MAPE (4.2%): Model is highly accurate across different sales levels
  • High R-squared (94%): Model captures almost all variation in sales patterns
  • Good Coverage (92%): Uncertainty estimates are well-calibrated and reliable
  • Business Impact: Enables confident inventory and resource planning

Business Impact

  • Inventory Optimization: Reduce stockouts by 35% and overstock by 28%
  • Staff Planning: Optimize seasonal hiring with 90% accuracy
  • Marketing Budget: Allocate $2M annual budget based on predicted demand
  • Cash Flow: Improve working capital management with 12-month visibility

Model Comparison

  • Simple Moving Average: 18% MAPE (baseline)
  • Linear Regression: 12% MAPE (trend only)
  • Prophet: 6.8% MAPE (good seasonality)
  • NeuralProphet: 4.2% MAPE (best overall)

When to Use NeuralProphet

Perfect for NeuralProphet

  • Time series forecasting - sequential data with time dependency
  • Strong seasonality - daily, weekly, monthly, yearly patterns
  • Multiple time series - forecasting many related series
  • External regressors - holidays, promotions, economic indicators
  • Uncertainty important - need confidence intervals for decisions
  • Business forecasting - sales, demand, revenue, traffic

Consider Other Methods When

  • Very short series - less than 100 observations
  • No clear patterns - random walk or pure noise
  • Real-time predictions - need millisecond response times
  • Simple linear trends - basic regression might suffice
  • Highly irregular data - many missing values or outliers

Business Applications

Sales forecasting, demand planning, financial projections, website traffic prediction

Alternative Methods

Prophet for simpler cases, LSTM for very complex patterns, ARIMA for traditional approach

Implementation

Python library with PyTorch backend, easy integration with existing data pipelines

Decision Framework: Choose NeuralProphet When

  • Data Type: Time series data with clear timestamps
  • Data Size: At least 200+ observations for good performance
  • Patterns: Observable seasonality, trends, or cyclical behavior
  • Business Need: Accurate forecasts with uncertainty estimates
  • External Factors: Holiday effects, promotions, or other known influences
  • Accuracy Priority: High accuracy is more important than interpretability