Skip to main content



Sinapsis Time Series Forecasting

Monorepo with packages to perform time series forecasting, preprocessing, and data loading.

🐍 Installation • 📦 Packages • 📚 Usage example • 🌐 Webapp • 📙 Documentation • 🔍 License

🐍 Installation

This monorepo currently consists of the following packages to handle time-series data:

  • sinapsis-darts-forecasting
  • sinapsis-sktime
  • sinapsis-timesfm

Install using your package manager of choice. We encourage the use of uv

Example with uv:

  uv pip install sinapsis-darts-forecasting --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-darts-forecasting --extra-index-url https://pypi.sinapsis.tech

with uv:

  uv pip install sinapsis-darts-forecasting[all] --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-darts-forecasting[all] --extra-index-url https://pypi.sinapsis.tech
  uv pip install sinapsis-time-series-forecasting[all] --extra-index-url https://pypi.sinapsis.tech

📦 Packages

Packages summary
  • Sinapsis Darts Forecasting (sinapsis-darts-forecasting)

    • CSV Loader
      Load time series data from CSV files into Darts TimeSeries objects.
    • Dataframe Loader
      Convert a pandas DataFrame into a Darts TimeSeries object.
    • Series Loader
      Convert a pandas Series into a Darts TimeSeries object.
    • Darts Transformers
      Apply data transformations (scaling, missing value filling, etc.) using Darts transformer classes.
    • Darts Models
      Fit and predict using Darts baseline, statistical, machine learning, and deep learning models.
    • Time Series Visualization
      Generate Matplotlib images and interactive Plotly HTML charts comparing historical and forecasted values.
    • Time Series Metrics
      Compute Darts metrics (MAE, RMSE, MAPE, etc.) between predicted and ground-truth time series.
  • Sinapsis SKTime (sinapsis-sktime)

    • SKTime Forecasters
      Train and generate predictions using sktime forecasting models (ARIMA, AutoARIMA, ExponentialSmoothing, Theta, NaiveForecaster, and more).
    • SKTime Classifiers
      Train and classify time series using sktime classification models (distance-based, dictionary-based, feature-based, deep learning, and dummy classifiers).
  • Sinapsis TimesFM (sinapsis-timesfm)

    • TimesFM
      Perform time series forecasting using Google's TimesFM foundation model.

For example, for XGBModelWrapper use sinapsis info --example-template-config XGBModelWrapper to produce the following example config:

agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: XGBModelWrapper
  class_name: XGBModelWrapper
  template_input: InputTemplate
  attributes:
    forecast_horizon: 10
    xgbmodel_init:
      lags: null
      lags_past_covariates: null
      lags_future_covariates: null
      output_chunk_length: 1
      output_chunk_shift: 0
      add_encoders: null
      likelihood: null
      quantiles: null
      random_state: null
      multi_models: true
      use_static_covariates: true

📚 Usage example

Below is an example configuration for **Sinapsis Darts Forecasting** using an XGBoost model. This setup extracts pandas DataFrames from the time series packet attributes and converts them into `TimeSeries` objects, using the `Date` column as the time index. Missing dates are filled with a daily frequency, and any missing values are interpolated using a linear method. The model is then trained and used to generate predictions with a forecast horizon of 100 days, with several configurable hyperparameters.
Example agent config
agent:
  name: XGBLSTMForecastingAgent
  description: ''

templates:

- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}

- template_name: TimeSeriesFromDataframeLoader
  class_name: TimeSeriesFromDataframeLoader
  template_input: InputTemplate
  attributes:
    apply_to: ["content", "past_covariates", "future_covariates"]
    from_pandas_kwargs:
      time_col: "Date"
      fill_missing_dates: True
      freq: "D"

- template_name: MissingValuesFiller
  class_name: MissingValuesFillerWrapper
  template_input: TimeSeriesFromDataframeLoader
  attributes:
    method: "transform"
    missingvaluesfiller_init: {}
    apply_to: ["content", "past_covariates", "future_covariates"]
    transform_kwargs:
      method: "linear"

- template_name: TimeSeries
  class_name: XGBModelWrapper
  template_input: MissingValuesFiller
  attributes:
    forecast_horizon: 100
    xgbmodel_init:
      lags: 30
      lags_past_covariates: 30
      output_chunk_length: 100
      random_state: 42
      n_estimators: 200
      learning_rate: 0.1
      max_depth: 6

To run, simply use:

sinapsis run name_of_the_config.yml

🌐 Webapp

The webapp provides an intuitive interface for data loading, preprocessing, and forecasting. The webapp supports CSV file uploads, visualization of historical data, and forecasting.

git clone git@github.com:Sinapsis-ai/sinapsis-time-series-forecasting.git
cd sinapsis-time-series-forecasting
🐳 Docker

IMPORTANT This docker image depends on the sinapsis-nvidia:base image. Please refer to the official sinapsis instructions to Build with Docker.

  1. Build the sinapsis-time-series-forecasting image:
docker compose -f docker/compose.yaml build
  1. Start the app container:
docker compose -f docker/compose_apps.yaml up sinapsis-darts-forecasting-gradio -d
  1. Check the status:
docker logs -f sinapsis-darts-forecasting-gradio
  1. The logs will display the URL to access the webapp, e.g.:

NOTE: The url can be different, check the output of logs

Running on local URL:  http://127.0.0.1:7860
  1. To stop the app:
docker compose -f docker/compose_apps.yaml down
💻 UV

To run the webapp using the uv package manager, please:

  1. Create the virtual environment and sync the dependencies:
uv sync --frozen
  1. Install the wheel:
uv pip install sinapsis-time-series-forecasting[all] --extra-index-url https://pypi.sinapsis.tech
  1. Run the webapp:
uv run webapps/darts_time_series_gradio_app.py
  1. The terminal will display the URL to access the webapp, e.g.:

NOTE: The url can be different, check the output of the terminal

Running on local URL:  http://127.0.0.1:7860

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Metadata

Release files for sinapsis-time-series 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinapsis-time-series 0.3.0
File Size Uploaded
sinapsis_time_series-0.3.0.tar.gz 41.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sinapsis-time-series 0.3.0
File Interpreter ABI Platform
sinapsis_time_series-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 89.9 kB

Release files / sinapsis_time_series-0.3.0.tar.gz

Download URL sinapsis_time_series-0.3.0.tar.gz
Size 41.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d819d24ea4b93ce295ae5d0c30bfe9985d3640562369d9b95ce135ddd8c85417
BLAKE2b-256 checksum
How to use checksums
ee08ebd4013dfb55e80f047dbe6a2122776b2a81b8bf89016bb2defb77987d5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release files / sinapsis_time_series-0.3.0-py3-none-any.whl

Download URL sinapsis_time_series-0.3.0-py3-none-any.whl
Size 48.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13f49bdcad4e9754aff49b893b2b917daa6b3b82cd47a5d312ea4fe44a3ec75d
BLAKE2b-256 checksum
How to use checksums
16be542a0909548fa90dd49747154fd3633593423d4cb06675f3ed280acf2c8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page