Store Sales Time Series Forecasting

Overview

This Hugging Face Space hosts an LSTM-based model (ImprovedCashFlowLSTM) for forecasting store sales over a 13-week horizon, trained on the Kaggle Store Sales Time Series Forecasting dataset.

Model Architecture

  • Type: LSTM
  • Input Size: 20 features
  • Hidden Size: 128
  • Number of Layers: 2
  • Dropout: 0.2
  • Forecast Horizon: 13 weeks
  • Parameters: 227,441
  • Features: sales, onpromotion, trend, dayofweek_sin, dayofweek_cos, month_sin, month_cos, is_weekend, quarter, sales_lag_1, sales_lag_7, sales_lag_14, sales_ma_7, sales_ma_14, sales_ratio_7, sales_ratio_14, promo_lag_1, promo_running_sum, dcoilwtico, is_holiday

Performance Metrics

  • MAE: $710.75
  • RMSE: $1108.36
  • MAPE: 7.16%
  • RΒ² Score: 0.8633

Graphs

Loss Curve

Loss Curve

Residual Graph

Residual Graph

Sample Prediction

Sample Prediction

Usage

  1. Synthetic Data: Click "Generate Synthetic Data" to create a 21-timestep sample dataset (sales ~$3,000–19,000) and view a 13-week forecast.
  2. Custom Data: Upload a CSV with 21 timesteps and 20 features matching the above feature names.
  3. Output: View forecasts in a table and Plotly graph with uncertainty bands.

Example

from inference import load_model_and_artifacts, predict
model, scaler, feature_names, config = load_model_and_artifacts()
sequences = scaler.transform(your_data[feature_names].values).reshape(1, 21, 20)
predictions, uncertainties = predict(model, scaler, sequences)
print("Predictions:", predictions)

Training Details

  • Dataset: Kaggle Store Sales Time Series Forecasting
  • Data Shape: (8250, 20)
  • Sequences: 8217, length 21
  • Preprocessing: StandardScaler, conservative outlier removal
  • Epochs: 70 (early stopping)
  • Optimizer: Adam with ReduceLROnPlateau
  • Loss: MSE

Limitations

  • Predictions are sensitive to input data quality and scaling.
  • Performance may degrade on low-sales stores (<$3,000) not included in training.
  • Assumes consistent feature engineering as in training.

License

MIT License

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results