CoolFace
Apppublic

Sapheneia/sapheneia-timesfm

sourceHugging Facemitupdated 11mo agoView on Hugging Face
1likes
App README

Sapheneia TimesFM: Time Series Forecasting with Google's Foundation Model

A professional web application for time series forecasting powered by Google's TimesFM (Time Series Foundation Model). Built for financial forecasting and analysis with advanced covariates support.

๐Ÿš€ Quick Start

  1. 1.Upload Your Data: Upload a CSV file with time series data
  2. 2.Configure Model: Set context length, horizon, and other parameters
  3. 3.Add Covariates (Optional): Enhance forecasts with exogenous variables
  4. 4.Generate Forecast: Get point forecasts with prediction intervals
  5. 5.Visualize & Download: Interactive charts and downloadable results

โœจ Features

Core Capabilities

  • โ€”TimesFM 2.0-500m Model: State-of-the-art foundation model for time series
  • โ€”Quantile Forecasting: Prediction intervals for uncertainty quantification
  • โ€”Covariates Support: Dynamic and static, numerical and categorical variables
  • โ€”Professional Visualizations: Publication-quality charts with Plotly
  • โ€”Interactive Interface: User-friendly web application

Advanced Features

  • โ€”Multi-Series Forecasting: Process multiple time series simultaneously
  • โ€”Flexible Horizons: Forecast from 1 to 128 periods ahead
  • โ€”Customizable Context: Use 64 to 2048 historical data points
  • โ€”Real-time Processing: Fast inference on CPU
  • โ€”Export Options: Download forecasts as CSV or HTML charts

๐Ÿ“Š Data Format

Your CSV file should have:

  • โ€”Date column as the first column
  • โ€”Time series columns with numerical values
  • โ€”Data definition JSON specifying column types:
json
{
  "price": "target",
  "temperature": "dynamic_numerical",
  "day_of_week": "dynamic_categorical",
  "store_id": "static_categorical",
  "base_sales": "static_numerical"
}

Column Types

  • โ€”target: Main time series to forecast
  • โ€”dynamic_numerical: Time-varying numerical covariates
  • โ€”dynamic_categorical: Time-varying categorical covariates
  • โ€”static_numerical: Series-level numerical features
  • โ€”static_categorical: Series-level categorical features

๐ŸŽฏ Use Cases

Financial Forecasting

  • โ€”Stock price prediction
  • โ€”Revenue forecasting
  • โ€”Trading volume estimation
  • โ€”Risk analysis

Business Analytics

  • โ€”Sales forecasting
  • โ€”Demand planning
  • โ€”Inventory optimization
  • โ€”Customer behavior prediction

Research & Academia

  • โ€”Economic indicators
  • โ€”Climate data analysis
  • โ€”Experimental time series
  • โ€”Comparative studies

๐Ÿ”ง Model Configuration

Recommended Settings

Quick Testing:

  • โ€”Context Length: 64
  • โ€”Horizon Length: 24
  • โ€”Backend: CPU

Production Use:

  • โ€”Context Length: 512-2048
  • โ€”Horizon Length: 24-128
  • โ€”Backend: CPU (or GPU for faster inference)

Covariates Configuration

When using covariates:

  • โ€”Dynamic covariates must cover context + horizon periods
  • โ€”Use xreg_mode="xreg + timesfm" for best results
  • โ€”Enable normalization for stability
  • โ€”Start with small ridge values (0.0-0.01)

๐Ÿ“š About TimesFM

TimesFM is a decoder-only foundation model for time-series forecasting, pre-trained on 100 billion real-world time points. Key features:

  • โ€”Foundation Model: Pre-trained on diverse time series data
  • โ€”Zero-Shot Forecasting: Works on new data without retraining
  • โ€”Attention-Based: Leverages transformer architecture
  • โ€”Production-Ready: Developed and tested by Google Research

Learn more: TimesFM Research Paper

๐Ÿ› ๏ธ Technical Stack

  • โ€”Model: Google TimesFM 2.0-500m (PyTorch)
  • โ€”Backend: Flask + Python 3.11
  • โ€”Visualization: Plotly + Matplotlib
  • โ€”ML Libraries: JAX, NumPy, Pandas, scikit-learn
  • โ€”Deployment: Docker on Hugging Face Spaces

๐Ÿ“– Documentation

๐Ÿค Contributing

Contributions are welcome! This is a research project focused on advancing TimesFM capabilities for practical applications.

๐Ÿ“„ License

MIT License - See LICENSE for details.

๐Ÿ™ Acknowledgments

  • โ€”Google Research for the TimesFM foundation model
  • โ€”Hugging Face for Spaces infrastructure
  • โ€”The open-source time series forecasting community

Note: This application runs on CPU by default. For faster inference on large datasets, consider using GPU-enabled Spaces.