Skip to main content

Module for handling time series data and forecasting using sktime.

Project description



Sinapsis SKTime

Module for handling time series data and forecasting using sktime.

🐍 Installation 🚀 Features 📚 Usage Example📙 Documentation 🔍 License

Sinapsis SKTime provides a powerful and flexible implementation for time series forecasting using the sktime library.

🐍 Installation

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

Example with uv:

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

or with raw pip:

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

🚀 Features

Templates Supported

The Sinapsis SKTime provides a powerful and flexible implementation for time series forecasting using the sktime library.

ThetaForecaster

The following attributes apply to ThetaForecaster template:

  • generic_field_key_data (str, required): The key of the generic field containing the time series data.

This template loads time series data from the specified generic field key and creates a TimeSeriesPacket which is then added to the DataContainer.

SKTime Forecasters

The following attributes apply to all SKTime forecasting templates:

  • generic_field_for_data (str, optional): The key of the generic field where datasets are stored. Defaults to "SKTimeDatasets".
  • model_save_path (str, required): Path where the trained model will be saved.
  • n_steps_ahead (int, optional): Number of steps ahead to forecast. Defaults to 37.

The package provides access to a wide range of forecasting models from sktime, including:

  • ARCH
  • StatsForecastARCH
  • StatsForecastGARCH
  • ARIMA
  • AutoARIMA
  • ExponentialSmoothing
  • StatsModelsARIMA
  • NaiveForecaster
  • NaiveVariance
  • ThetaForecaster
  • ThetaModularForecaster
  • TrendForecaster
  • PolynomialTrendForecaster

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis SKTime.

[!TIP] Use CLI command sinapsis info --example-template-config TEMPLATE_NAME to produce an example Agent config for the Template specified in TEMPLATE_NAME.

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

agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: ThetaForecasterSKTimeWrapper
  class_name: ThetaForecasterSKTimeWrapper
  template_input: InputTemplate
  attributes:
    root_dir: '`replace_me:<class ''str''>`'
    model_save_path: '`replace_me:<class ''str''>`'
    n_steps_ahead: 37
    thetaforecaster_init:
      initial_level: null
      deseasonalize: true
      sp: 1
      deseasonalize_model: multiplicative

📚 Usage Example

Below is an example configuration for **Sinapsis SKTime** using a Theta forecasting model. This setup loads time series data into a TimeSeriesPacket and applies the Theta model for forecasting.
Example config
agent:
  name: ThetaForecasterAgent
  description: 'Agent for time series forecasting using Theta'

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name: load_airlineWrapper
    class_name: load_airlineWrapper
    template_input: InputTemplate
    attributes:
      split_dataset: true
      train_size: 0.8
      store_as_time_series: True
      load_airline:
        {}

  - template_name: ThetaForecasterSKTimeWrapper
    class_name: ThetaForecasterSKTimeWrapper
    template_input: load_airlineWrapper
    attributes:
      generic_field_key: load_airlineWrapper
      n_steps_ahead: 12
      forecast_horizon_in_fit: true
      model_save_path: "artifacts/theta_forecaster.pkl"
      task_type: "forecasting"
      thetaforecaster_init:
        sp: 12

This configuration defines an agent and a sequence of templates to handle the data and perform predictions.

To run the config, use the CLI:

sinapsis run name_of_config.yml

📙 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinapsis_sktime-0.1.0.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinapsis_sktime-0.1.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_sktime-0.1.0.tar.gz.

File metadata

  • Download URL: sinapsis_sktime-0.1.0.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.16

File hashes

Hashes for sinapsis_sktime-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d4e8723018e86d6928cab1e6a45b90889203eb944936833007a4c20d09529cd6
MD5 3ac49ea4e02d1745227944516018df99
BLAKE2b-256 5fa1c452c3df1f39450688a996b98fcd68d5094f2f5a23a5e7cbac404cbe122e

See more details on using hashes here.

File details

Details for the file sinapsis_sktime-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_sktime-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04c57491a4509cdbdfb597b66a06eb00dfbcd3f531c5c8df7fbe50c20c074eb0
MD5 fc229ccdb2b670fa639f9cc0728ab537
BLAKE2b-256 9178b1b70a7387eebd8ec6c7d3a3eca91db61db52c64d891a1f8fec0ade39633

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page