https://github.com/tinkoff-ai/etna

ETNA – Time-Series Library

https://github.com/tinkoff-ai/etna

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 27 committers (7.4%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.9%) to scientific vocabulary

Keywords

deep-learning forecasting machine-learning python time-series timeseries
Last synced: 5 months ago · JSON representation

Repository

ETNA – Time-Series Library

Basic Info
  • Host: GitHub
  • Owner: tinkoff-ai
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage: https://etna.tinkoff.ru
  • Size: 128 MB
Statistics
  • Stars: 881
  • Watchers: 10
  • Forks: 83
  • Open Issues: 49
  • Releases: 36
Archived
Topics
deep-learning forecasting machine-learning python time-series timeseries
Created over 4 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

Predict your time series the easiest way

PyPI Version Python versions Downloads

Coverage Test passing Docs publish License

Telegram GitHub Discussions Contributors Stars

Homepage | Documentation | Tutorials | Contribution Guide | Release Notes

ETNA is an easy-to-use time series forecasting framework. It includes built in toolkits for time series preprocessing, feature generation, a variety of predictive models with unified interface - from classic machine learning to SOTA neural networks, models combination methods and smart backtesting. ETNA is designed to make working with time series simple, productive, and fun.

ETNA is the first python open source framework of Tinkoff.ru Artificial Intelligence Center. The library started as an internal product in our company - we use it in over 10+ projects now, so we often release updates. Contributions are welcome - check our Contribution Guide.

Get started

Let's load and prepare the data. ```python import pandas as pd from etna.datasets import TSDataset

Read the data

df = pd.readcsv("examples/data/exampledataset.csv")

Create a TSDataset

df = TSDataset.to_dataset(df) ts = TSDataset(df, freq="D")

Choose a horizon

HORIZON = 14

Make train/test split

traints, testts = ts.traintestsplit(test_size=HORIZON) ```

Define transformations and model: ```python from etna.models import CatBoostMultiSegmentModel from etna.transforms import DateFlagsTransform from etna.transforms import DensityOutliersTransform from etna.transforms import FourierTransform from etna.transforms import LagTransform from etna.transforms import LinearTrendTransform from etna.transforms import MeanTransform from etna.transforms import SegmentEncoderTransform from etna.transforms import TimeSeriesImputerTransform from etna.transforms import TrendTransform

Prepare transforms

transforms = [ DensityOutliersTransform(incolumn="target", distancecoef=3.0), TimeSeriesImputerTransform(incolumn="target", strategy="forwardfill"), LinearTrendTransform(incolumn="target"), TrendTransform(incolumn="target", outcolumn="trend"), LagTransform(incolumn="target", lags=list(range(HORIZON, 122)), outcolumn="targetlag"), DateFlagsTransform(weeknumberinmonth=True, outcolumn="dateflag"), FourierTransform(period=360.25, order=6, outcolumn="fourier"), SegmentEncoderTransform(), MeanTransform(incolumn=f"targetlag{HORIZON}", window=12, seasonality=7), MeanTransform(incolumn=f"targetlag{HORIZON}", window=7), ]

Prepare model

model = CatBoostMultiSegmentModel() ```

Fit Pipeline and make a prediction: ```python from etna.pipeline import Pipeline

Create and fit the pipeline

pipeline = Pipeline(model=model, transforms=transforms, horizon=HORIZON) pipeline.fit(train_ts)

Make a forecast

forecast_ts = pipeline.forecast() ```

Let's plot the results: ```python from etna.analysis import plot_forecast

plotforecast(forecastts=forecastts, testts=testts, traints=traints, ntrain_samples=50) ```

Print the metric value across the segments: ```python from etna.metrics import SMAPE

metric = SMAPE(mode="macro") metricvalue = metric(ytrue=testts, ypred=forecast_ts)

{'segmentb': 3.3017151519000967, 'segmentc': 5.270557433427279, 'segmenta': 5.272811627335398, 'segmentd': 4.689085450895735} ```

Installation

ETNA is available on PyPI, so you can use pip to install it.

Install default version: bash pip install --upgrade pip pip install etna

The default version doesn't contain all the dependencies, because some of them are needed only for specific models, e.g. Prophet, PyTorch. Available user extensions are the following: * prophet: adds prophet model, *torch: adds models based on neural nets, *wandb: adds wandb logger, *auto: adds AutoML functionality, *classiciation`: adds time series classification functionality.

Install extension: bash pip install etna[extension-name]

Install all extensions: bash pip install etna[all]

There are also developer extensions. All the extensions are listed in pyproject.toml.

Without the appropriate extension you will get an ImportError trying to import the model that needs it. For example, etna.models.ProphetModel needs prophet extension and can't be used without it.

Configuration

ETNA supports configuration files. It means that library will check that all the specified packages are installed prior to script start and NOT during runtime.

To set up a configuration for your project you should create a .etna file at the project's root. To see the available options look at Settings. There is an example of configuration file.

Tutorials

We have also prepared a set of tutorials for an easy introduction:

| Notebook | Interactive launch | |:----------|------:| | Get started | Binder | | Backtest | Binder | | EDA | Binder | | Regressors and exogenous data | Binder | | Custom model and transform | Binder | | Deep learning models | Binder | | Ensembles | Binder | | Outliers | Binder | | Forecasting strategies | Binder | | Forecast interpretation | Binder | | Clustering | Binder | | AutoML | Binder | | Inference: using saved pipeline on a new data | Binder | | Hierarchical time series | Binder | | Classification | Binder | | Feature selection | Binder |

Documentation

ETNA documentation is available here.

Community

To ask the questions or discuss the library you can join our telegram chat. Discussions section on github is also open for this purpose.

Resources

Acknowledgments

ETNA.Team

Andrey Alekseev, Nikita Barinov, Dmitriy Bunin, Aleksandr Chikov, Vladislav Denisov, Martin Gabdushev, Sergey Kolesnikov, Artem Makhin, Ivan Mitskovets, Albina Munirova, Julia Shenshina, Yuriy Tarasyuk, Konstantin Vedernikov, Ivan Nedosekov, Rodion Petrov

ETNA.Contributors

WinstonDovlatov, mvakhmenin, Carlosbogo, Pacman1984, looopka, Artem Levashov, Aleksey Podkidyshev

License

Feel free to use our library in your commercial and private applications.

ETNA is covered by Apache 2.0. Read more about this license here

Please note that etna[prophet] is covered by GPL 2.0 due to pystan package.

Owner

  • Name: Tinkoff.AI
  • Login: tinkoff-ai
  • Kind: organization
  • Location: Russian Federation

Tinkoff AI Center

GitHub Events

Total
  • Watch event: 35
  • Fork event: 2
Last Year
  • Watch event: 35
  • Fork event: 2

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 515
  • Total Committers: 27
  • Avg Commits per committer: 19.074
  • Development Distribution Score (DDS): 0.717
Top Committers
Name Email Commits
Mr-Geekman 3****n@u****m 146
alex-hse-repository 5****y@u****m 78
Andrey Alekseev i****v@g****m 77
Martin Gabdushev 3****n@u****m 72
Julia Shenshina y****a@p****u 35
Artyom Makhin 4****6@u****m 24
d.a.bunin d****n@t****u 10
Nikita Barinov d****r@y****u 9
Maxim Zherelo 6****0@u****m 9
scanhex12 7****2@u****m 8
DBcreator 4****r@u****m 8
Nikolai Romantsov 7****v@u****m 8
Nikita Barinov 3****r@u****m 5
Габдушев Мартин Маратович m****v@t****u 4
Romantsov Nikolay n****v@e****u 3
a.p.chikov a****v@m****v 3
Vlad Ilyuhin 9****t@u****m 3
Aleksandr Smetanin r****n@g****m 2
looopka f****a@g****m 2
mvakhmenin 8****n@u****m 2
Sergey Kolesnikov s****r@g****m 1
Carlosbogo 8****o@u****m 1
GrozniyToaster 6****r@u****m 1
albinamunirova 3****a@u****m 1
Pacman1984 1****4@u****m 1
martins0n m****l@m****u 1
an.alekseev a****v@t****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 127
  • Total pull requests: 131
  • Average time to close issues: 3 months
  • Average time to close pull requests: 11 days
  • Total issue authors: 16
  • Total pull request authors: 9
  • Average comments per issue: 1.0
  • Average comments per pull request: 3.92
  • Merged pull requests: 118
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Mr-Geekman (52)
  • alex-hse-repository (20)
  • martins0n (9)
  • brsnw250 (7)
  • iKintosh (4)
  • ostreech1997 (1)
  • TsoyAlV (1)
  • RomanGarayev (1)
  • vukeep (1)
  • julia-shenshina (1)
  • TDL77 (1)
  • malodetz (1)
  • MGodgildieva (1)
  • dimka11 (1)
  • nikolskydn (1)
Pull Request Authors
  • Mr-Geekman (69)
  • brsnw250 (12)
  • ostreech1997 (6)
  • alex-hse-repository (6)
  • malodetz (4)
  • GrozniyToaster (2)
  • GooseIt (1)
  • DBcreator (1)
  • scanhex12 (1)
Top Labels
Issue Labels
enhancement (72) bug (29) priority/high (19) priority/medium (11) documentation (10) good first issue (4) DKO (3) help wanted (2) question (2) priority/low (1) example (1)
Pull Request Labels
bug (4) enhancement (3) experimental (1) documentation (1)

Dependencies

benchmarks/perfomance/requirements.txt pypi
  • hydra-core <1.2.0
  • intervaltree *
  • py-spy <0.4.0
docker/etna-cpu/requirements.txt pypi
  • etna *
  • jupyter *
poetry.lock pypi
  • 232 dependencies
pyproject.toml pypi
  • Bottleneck ^1.3.4
  • Deprecated 1.2.13
  • GitPython ^3.1.20
  • Sphinx ^4.1
  • black ^22.3.0
  • boto3 ^1.5
  • botocore *
  • catboost >=0.21
  • click >=8.0.1, <8.1
  • codespell ^2.0.0
  • coverage ^5.4
  • dill ^0.3.4
  • flake8 ^3.9.2
  • flake8-bugbear ^22.4.25
  • flake8-comprehensions ^3.9.0
  • flake8-docstrings ^1.6.0
  • holidays ^0.11.3
  • hydra-slayer ^0.2.0
  • hydra_slayer *
  • ipywidgets ^7.6.5
  • isort ^5.8.0
  • joblib *
  • jupyter *
  • loguru ^0.5.3
  • matplotlib *
  • mypy ^0.910
  • myst-parser ^0.15.0
  • nbconvert *
  • nbsphinx ^0.8.2
  • numba >=0.53.1,<0.56.0
  • numpy *
  • numpydoc ^1.1.0
  • omegaconf ^2.1.1
  • pandas ^1
  • pep8-naming ^0.12.1
  • plotly *
  • pmdarima >=1.8.0
  • prophet ^1.0
  • pytest ^6.2
  • pytest-cov ^2.11.1
  • python >=3.7.1, <3.10.0
  • pytorch-forecasting ^0.9.0
  • pytorch-lightning *
  • ruptures 1.1.5
  • scikit-learn >=0.24, <2
  • scipy <1.8.0
  • seaborn ^0.11.1
  • semver ^2.13.0
  • sphinx-mathjax-offline ^0.0.1
  • sphinx-rtd-theme ^0.5.1
  • statsmodels >=0.12,<0.14
  • tbats ^1.1.0
  • toml ^0.10.2
  • torch >=1.8.0,<1.12.0
  • typer ^0.4.0
  • types-Deprecated 1.2.9
  • types-PyYAML ^6.0.0
  • typing_extensions *
  • wandb ^0.12.2
.github/workflows/docker-unstable.yml actions
  • actions/checkout v2 composite
.github/workflows/docs-on-pr.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • nwtgck/actions-netlify v1.2 composite
  • snok/install-poetry v1 composite
.github/workflows/docs-unstable.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • nwtgck/actions-netlify v1.2 composite
  • snok/install-poetry v1 composite
.github/workflows/notebooks.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • snok/install-poetry v1 composite
.github/workflows/publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • nwtgck/actions-netlify v1.2 composite
.github/workflows/test.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v2 composite
  • snok/install-poetry v1 composite
docker/etna-cpu/Dockerfile docker
  • ${BASE_IMAGE} latest build
docker/etna-cuda-11.6.2/Dockerfile docker
  • ${BASE_IMAGE} latest build
docker/etna-cuda-11.6.2/requirements.txt pypi
  • etna *
  • jupyterlab *
.github/workflows/cron-delete-untagged-images.yml actions
.binder/requirements.txt pypi