A library for forecasting compositional time series
Project description
compotime
compotime is a library for forecasting compositional time series. At the moment, it provides an implementation of the models described in the paper "Forecasting compositional time series: A state space approach" (Snyder, R.D. et al, 2017). It is constantly tested to be compatible with the major machine learning and statistics libraries within the Python ecosystem.
Quick install
compotime is currently available for python 3.9, 3.10 and 3.11. It can be installed from PyPI:
pip install compotime
Basic usage
This example uses adapted data on the popularity of programming languages (PYPL).
import pandas as pd
from compotime import LocalTrendForecaster, preprocess
URL = "https://raw.githubusercontent.com/mateuja/compotime/main/examples/data/proglangpop_sample.csv"
time_series = pd.read_csv(URL, converters={"Date": pd.Period}, index_col="Date").pipe(
preprocess.treat_small, 1e-3
)
model = LocalTrendForecaster().fit(time_series)
model.predict(horizon=10)
For more details, see the Documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file compotime-0.3.0.tar.gz
.
File metadata
- Download URL: compotime-0.3.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1042-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71d314e4f1d8e345c0bacf6200c8dd201bf38f1c9778d3fb4d5a091eacc6f5c |
|
MD5 | aff2ce2e4c8e350cd6d8d9dfd03225ca |
|
BLAKE2b-256 | a5e1386ff73392262dd0818cc29cd71f0385b7124c9305bebc6fdd5215ea91d4 |
File details
Details for the file compotime-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: compotime-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1042-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7680413c15ea2d0759faacf5cc02635b241209493f5d6d20448d45dacc599dd5 |
|
MD5 | 87ca54a4bf2c7897022d8e20123af8a5 |
|
BLAKE2b-256 | 53ae36fe408c4d503590ef543d1babb17e4297beae4614f2df2e8f7eeb0c0aeb |