{"id":15018046,"url":"https://github.com/timeseriesai/tsai","last_synced_at":"2026-10-26T20:19:42.419Z","repository":{"id":37385606,"uuid":"211822289","full_name":"timeseriesAI/tsai","owner":"timeseriesAI","description":"Time series Timeseries Deep Learning Machine Learning Python Pytorch  fastai | State-of-the-art Deep Learning library  for Time Series and Sequences in Pytorch / fastai","archived":false,"fork":false,"pushed_at":"2026-07-23T21:55:35.000Z","size":1561027,"stargazers_count":6133,"open_issues_count":30,"forks_count":720,"subscribers_count":62,"default_branch":"main","last_synced_at":"2026-10-20T20:47:12.900Z","etag":null,"topics":["classification","cnn","deep-learning","fastai","forecasting","inceptiontime","machine-learning","python","pytorch","regression","rnn","rocket","self-supervised","sequential","state-of-the-art","time-series","time-series-analysis","time-series-classification","timeseries","transformer"],"latest_commit_sha":null,"homepage":"https://timeseriesai.github.io/tsai/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timeseriesAI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"accessibility":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":"CLAUDE.md","gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2019-09-30T09:18:31.000Z","updated_at":"2026-10-20T15:46:48.000Z","dependencies_parsed_at":"2026-10-20T20:38:16.323Z","dependency_job_id":null,"html_url":"https://github.com/timeseriesAI/tsai","commit_stats":{"total_commits":1145,"total_committers":24,"mean_commits":"47.708333333333336","dds":0.388646288209607,"last_synced_commit":"bdff96cc8c4c8ea55bc20d7cffd6a72e402f4cb2"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/timeseriesAI/tsai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeseriesAI%2Ftsai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeseriesAI%2Ftsai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeseriesAI%2Ftsai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeseriesAI%2Ftsai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timeseriesAI","download_url":"https://codeload.github.com/timeseriesAI/tsai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeseriesAI%2Ftsai/sbom","scorecard":{"id":885872,"data":{"date":"2025-08-11","repo":{"name":"github.com/timeseriesAI/tsai","commit":"9e6f78cec5b8397deed8a3e6f4ace3269473e8ea"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/deploy.yaml:1","Warn: no topLevel permission defined: .github/workflows/test.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy.yaml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/timeseriesAI/tsai/deploy.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yaml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/timeseriesAI/tsai/test.yaml/main?enable=pin","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T10:01:17.431Z","repository_id":37385606,"created_at":"2025-08-24T10:01:17.431Z","updated_at":"2025-08-24T10:01:17.431Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":345082042,"owners_count":38477967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-22T02:00:06.372Z","response_time":122,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","cnn","deep-learning","fastai","forecasting","inceptiontime","machine-learning","python","pytorch","regression","rnn","rocket","self-supervised","sequential","state-of-the-art","time-series","time-series-analysis","time-series-classification","timeseries","transformer"],"created_at":"2024-09-24T19:51:21.611Z","updated_at":"2026-10-22T20:15:33.700Z","avatar_url":"https://github.com/timeseriesAI.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tsai\n\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://github.com/timeseriesAI/tsai/blob/main/nbs/multimedia/tsai_logo.svg?raw=true\" width=\"50%\"\u003e\n\n\u003c/div\u003e\n\n\u003cbr /\u003e \u003cbr /\u003e\n\n![CI](https://github.com/timeseriesai/tsai/workflows/CI/badge.svg)\n[![PyPI](https://img.shields.io/pypi/v/tsai?color=blue\u0026label=pypi%20version.png)](https://pypi.org/project/tsai/#description)\n[![DOI](https://zenodo.org/badge/211822289.svg)](https://zenodo.org/badge/latestdoi/211822289)\n![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/timeseriesAI/tsai)\n\n## Description\n\n\u003e State-of-the-art Deep Learning library for Time Series and Sequences.\n\n`tsai` is an open-source deep learning package built on top of Pytorch \u0026\nfastai focused on state-of-the-art techniques for time series tasks like\nclassification, regression, forecasting, imputation…\n\n`tsai` is currently under active development by timeseriesAI.\n\n## What’s new:\n\nDuring the last few releases, here are some of the most significant\nadditions to `tsai`:\n\n- **New models**: PatchTST (Accepted by ICLR 2023), RNN with Attention\n  (RNNAttention, LSTMAttention, GRUAttention), TabFusionTransformer, …\n- **New datasets**: we have increased the number of datasets you can\n  download using `tsai`:\n  - 128 univariate classification datasets\n  - 30 multivariate classification datasets\n  - 15 regression datasets\n  - 62 forecasting datasets\n  - 9 long term forecasting datasets\n- **New tutorials**:\n  [PatchTST](https://github.com/timeseriesAI/tsai/blob/main/tutorial_nbs/15_PatchTST_a_new_transformer_for_LTSF.ipynb).\n  Based on some of your requests, we are planning to release additional\n  tutorials on data preparation and forecasting.\n- **New functionality**: sklearn-type pipeline transforms, walk-foward\n  cross validation, reduced RAM requirements, and a lot of new\n  functionality to perform more accurate time series forecasts.\n- Pytorch 2.0 support.\n\n## Installation\n\n### Installation\n\n\u003e **Requires Python 3.10 or newer.** As of tsai 1.0.0, support for\n\u003e Python 3.9 has been dropped. See the\n\u003e [CHANGELOG](https://github.com/timeseriesAI/tsai/blob/main/CHANGELOG.md)\n\u003e for full upgrade notes if you’re coming from 0.x.\n\n#### Pip install\n\nInstall the **latest stable** version from PyPI:\n\n``` python\npip install tsai\n```\n\nFor an editable install (development or bleeding-edge):\n\n``` python\ngit clone https://github.com/timeseriesAI/tsai\npip install -e \"tsai[dev]\"\n```\n\ntsai installs only hard dependencies by default. Optional dependencies\n(sktime, tsfresh, PyWavelets, nbformat) are only needed for selected\ntasks; tsai will prompt you to install them when required. To install\neverything up front:\n\n``` python\npip install tsai[extras]\n```\n\n#### Conda install\n\nAs of tsai 1.0.0 the conda channel is no longer updated; tsai is\ndistributed via PyPI only. Older releases remain available on the\n[timeseriesai conda channel](https://anaconda.org/timeseriesai/tsai),\nbut for new installs please use `pip`.\n\n## Documentation\n\nHere’s the link to the\n[documentation](https://timeseriesai.github.io/tsai/).\n\n## Available models:\n\nHere’s a list with some of the state-of-the-art models available in\n`tsai`:\n\n- [LSTM](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/RNN.py)\n  (Hochreiter, 1997)\n  ([paper](https://ieeexplore.ieee.org/abstract/document/6795963/))\n- [GRU](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/RNN.py)\n  (Cho, 2014) ([paper](https://arxiv.org/abs/1412.3555))\n- [MLP](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/MLP.py) -\n  Multilayer Perceptron (Wang, 2016)\n  ([paper](https://arxiv.org/abs/1611.06455))\n- [FCN](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/FCN.py) -\n  Fully Convolutional Network (Wang, 2016)\n  ([paper](https://arxiv.org/abs/1611.06455))\n- [ResNet](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/ResNet.py) -\n  Residual Network (Wang, 2016)\n  ([paper](https://arxiv.org/abs/1611.06455))\n- [LSTM-FCN](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/RNN_FCN.py)\n  (Karim, 2017) ([paper](https://arxiv.org/abs/1709.05206))\n- [GRU-FCN](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/RNN_FCN.py)\n  (Elsayed, 2018) ([paper](https://arxiv.org/abs/1812.07683))\n- [mWDN](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/mWDN.py) -\n  Multilevel wavelet decomposition network (Wang, 2018)\n  ([paper](https://dl.acm.org/doi/abs/10.1145/3219819.3220060))\n- [TCN](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/TCN.py) -\n  Temporal Convolutional Network (Bai, 2018)\n  ([paper](https://arxiv.org/abs/1803.01271))\n- [MLSTM-FCN](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/RNN_FCN.py) -\n  Multivariate LSTM-FCN (Karim, 2019)\n  ([paper](https://www.sciencedirect.com/science/article/abs/pii/S0893608019301200))\n- [InceptionTime](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/InceptionTime.py)\n  (Fawaz, 2019) ([paper](https://arxiv.org/abs/1909.04939))\n- [Rocket](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/ROCKET.py)\n  (Dempster, 2019) ([paper](https://arxiv.org/abs/1910.13051))\n- [XceptionTime](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/XceptionTime.py)\n  (Rahimian, 2019) ([paper](https://arxiv.org/abs/1911.03803))\n- [ResCNN](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/ResCNN.py) -\n  1D-ResCNN (Zou , 2019)\n  ([paper](https://www.sciencedirect.com/science/article/pii/S0925231219311506))\n- [TabModel](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/TabModel.py) -\n  modified from fastai’s\n  [TabularModel](https://docs.fast.ai/tabular.model.html#TabularModel)\n- [OmniScale](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/OmniScaleCNN.py) -\n  Omni-Scale 1D-CNN (Tang, 2020)\n  ([paper](https://arxiv.org/abs/2002.10061))\n- [TST](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/TST.py) -\n  Time Series Transformer (Zerveas, 2020)\n  ([paper](https://dl.acm.org/doi/abs/10.1145/3447548.3467401))\n- [TabTransformer](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/TabTransformer.py)\n  (Huang, 2020) ([paper](https://arxiv.org/pdf/2012.06678))\n- [TSiT](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/TSiTPlus.py)\n  Adapted from ViT (Dosovitskiy, 2020)\n  ([paper](https://arxiv.org/abs/2010.11929))\n- [MiniRocket](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/MINIROCKET.py)\n  (Dempster, 2021) ([paper](https://arxiv.org/abs/2102.00457))\n- [XCM](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/XCM.py) -\n  An Explainable Convolutional Neural Network (Fauvel, 2021)\n  ([paper](https://hal.inria.fr/hal-03469487/document))\n- [gMLP](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/gMLP.py) -\n  Gated Multilayer Perceptron (Liu, 2021)\n  ([paper](https://arxiv.org/abs/2105.08050))\n- [TSPerceiver](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/TSPerceiver.py) -\n  Adapted from Perceiver IO (Jaegle, 2021)\n  ([paper](https://arxiv.org/abs/2107.14795))\n- [GatedTabTransformer](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/GatedTabTransformer.py)\n  (Cholakov, 2022) ([paper](https://arxiv.org/abs/2201.00199))\n- [TSSequencerPlus](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/TSSequencerPlus.py) -\n  Adapted from Sequencer (Tatsunami, 2022)\n  ([paper](https://arxiv.org/abs/2205.01972))\n- [PatchTST](https://github.com/timeseriesAI/tsai/blob/main/tsai/models/PatchTST.py) -\n  (Nie, 2022) ([paper](https://arxiv.org/abs/2211.14730))\n\nplus other custom models like: TransformerModel, LSTMAttention,\nGRUAttention, …\n\n## How to start using tsai?\n\nTo get to know the tsai package, we’d suggest you start with this\nnotebook in Google Colab:\n**[01_Intro_to_Time_Series_Classification](https://colab.research.google.com/github/timeseriesAI/tsai/blob/master/tutorial_nbs/01_Intro_to_Time_Series_Classification.ipynb)**\nIt provides an overview of a time series classification task.\n\nWe have also develop many other [tutorial\nnotebooks](https://github.com/timeseriesAI/tsai/tree/main/tutorial_nbs).\n\nTo use tsai in your own notebooks, the only thing you need to do after\nyou have installed the package is to run this:\n\n``` python\nfrom tsai.all import *\n```\n\n## Examples\n\nThese are just a few examples of how you can use `tsai`:\n\n### Binary, univariate classification\n\n**Training:**\n\n``` python\nfrom tsai.basics import *\n\nX, y, splits = get_classification_data('ECG200', split_data=False)\ntfms = [None, TSClassification()]\nbatch_tfms = TSStandardize()\nclf = TSClassifier(X, y, splits=splits, path='models', arch=\"InceptionTimePlus\", tfms=tfms, batch_tfms=batch_tfms, metrics=accuracy, cbs=ShowGraph())\nclf.fit_one_cycle(100, 3e-4)\nclf.export(\"clf.pkl\") \n```\n\n**Inference:**\n\n``` python\nfrom tsai.inference import load_learner\n\nclf = load_learner(\"models/clf.pkl\")\nprobas, target, preds = clf.get_X_preds(X[splits[1]], y[splits[1]])\n```\n\n### Multi-class, multivariate classification\n\n**Training:**\n\n``` python\nfrom tsai.basics import *\n\nX, y, splits = get_classification_data('LSST', split_data=False)\ntfms = [None, TSClassification()]\nbatch_tfms = TSStandardize(by_sample=True)\nmv_clf = TSClassifier(X, y, splits=splits, path='models', arch=\"InceptionTimePlus\", tfms=tfms, batch_tfms=batch_tfms, metrics=accuracy, cbs=ShowGraph())\nmv_clf.fit_one_cycle(10, 1e-2)\nmv_clf.export(\"mv_clf.pkl\")\n```\n\n**Inference:**\n\n``` python\nfrom tsai.inference import load_learner\n\nmv_clf = load_learner(\"models/mv_clf.pkl\")\nprobas, target, preds = mv_clf.get_X_preds(X[splits[1]], y[splits[1]])\n```\n\n### Multivariate Regression\n\n**Training:**\n\n``` python\nfrom tsai.basics import *\n\nX, y, splits = get_regression_data('AppliancesEnergy', split_data=False)\ntfms = [None, TSRegression()]\nbatch_tfms = TSStandardize(by_sample=True)\nreg = TSRegressor(X, y, splits=splits, path='models', arch=\"TSTPlus\", tfms=tfms, batch_tfms=batch_tfms, metrics=rmse, cbs=ShowGraph(), verbose=True)\nreg.fit_one_cycle(100, 3e-4)\nreg.export(\"reg.pkl\")\n```\n\n**Inference:**\n\n``` python\nfrom tsai.inference import load_learner\n\nreg = load_learner(\"models/reg.pkl\")\nraw_preds, target, preds = reg.get_X_preds(X[splits[1]], y[splits[1]])\n```\n\nThe ROCKETs (RocketClassifier, RocketRegressor, MiniRocketClassifier,\nMiniRocketRegressor, MiniRocketVotingClassifier or\nMiniRocketVotingRegressor) are somewhat different models. They are not\nactually deep learning models (although they use convolutions) and are\nused in a different way.\n\n⚠️ You’ll also need to install sktime to be able to use them. You can\ninstall it separately:\n\n``` python\npip install sktime\n```\n\nor use:\n\n``` python\npip install tsai[extras]\n```\n\n**Training:**\n\n``` python\nfrom sklearn.metrics import mean_squared_error, make_scorer\nfrom tsai.data.external import get_Monash_regression_data\nfrom tsai.models.MINIROCKET import MiniRocketRegressor\n\nX_train, y_train, *_ = get_Monash_regression_data('AppliancesEnergy')\nrmse_scorer = make_scorer(mean_squared_error, greater_is_better=False)\nreg = MiniRocketRegressor(scoring=rmse_scorer)\nreg.fit(X_train, y_train)\nreg.save('MiniRocketRegressor')\n```\n\n**Inference:**\n\n``` python\nfrom sklearn.metrics import mean_squared_error\nfrom tsai.data.external import get_Monash_regression_data\nfrom tsai.models.MINIROCKET import load_minirocket\n\n*_, X_test, y_test = get_Monash_regression_data('AppliancesEnergy')\nreg = load_minirocket('MiniRocketRegressor')\ny_pred = reg.predict(X_test)\nmean_squared_error(y_test, y_pred, squared=False)\n```\n\n### Forecasting\n\nYou can use tsai for forecast in the following scenarios:\n\n- univariate or multivariate time series input\n- univariate or multivariate time series output\n- single or multi-step ahead\n\nYou’ll need to: \\* prepare X (time series input) and the target y (see\n[documentation](https://timeseriesai.github.io/tsai/data.preparation.html))\n\\* select PatchTST or one of tsai’s models ending in Plus (TSTPlus,\nInceptionTimePlus, TSiTPlus, etc). The model will auto-configure a head\nto yield an output with the same shape as the target input y.\n\n#### Single step\n\n**Training:**\n\n``` python\nfrom tsai.basics import *\n\nts = get_forecasting_time_series(\"Sunspots\").values\nX, y = SlidingWindow(60, horizon=1)(ts)\nsplits = TimeSplitter(235)(y) \ntfms = [None, TSForecasting()]\nbatch_tfms = TSStandardize()\nfcst = TSForecaster(X, y, splits=splits, path='models', tfms=tfms, batch_tfms=batch_tfms, bs=512, arch=\"TSTPlus\", metrics=mae, cbs=ShowGraph())\nfcst.fit_one_cycle(50, 1e-3)\nfcst.export(\"fcst.pkl\")\n```\n\n**Inference:**\n\n``` python\nfrom tsai.inference import load_learner\n\nfcst = load_learner(\"models/fcst.pkl\", cpu=False)\nraw_preds, target, preds = fcst.get_X_preds(X[splits[1]], y[splits[1]])\nraw_preds.shape\n# torch.Size([235, 1])\n```\n\n#### Multi-step\n\nThis example show how to build a 3-step ahead univariate forecast.\n\n**Training:**\n\n``` python\nfrom tsai.basics import *\n\nts = get_forecasting_time_series(\"Sunspots\").values\nX, y = SlidingWindow(60, horizon=3)(ts)\nsplits = TimeSplitter(235, fcst_horizon=3)(y) \ntfms = [None, TSForecasting()]\nbatch_tfms = TSStandardize()\nfcst = TSForecaster(X, y, splits=splits, path='models', tfms=tfms, batch_tfms=batch_tfms, bs=512, arch=\"TSTPlus\", metrics=mae, cbs=ShowGraph())\nfcst.fit_one_cycle(50, 1e-3)\nfcst.export(\"fcst.pkl\")\n```\n\n**Inference:**\n\n``` python\nfrom tsai.inference import load_learner\nfcst = load_learner(\"models/fcst.pkl\", cpu=False)\nraw_preds, target, preds = fcst.get_X_preds(X[splits[1]], y[splits[1]])\nraw_preds.shape\n# torch.Size([235, 3])\n```\n\n## Input data format\n\nThe input format for all time series models and image models in tsai is\nthe same. An np.ndarray (or array-like object like zarr, etc) with 3\ndimensions:\n\n**\\[# samples x \\# variables x sequence length\\]**\n\nThe input format for tabular models in tsai (like TabModel,\nTabTransformer and TabFusionTransformer) is a pandas dataframe. See\n[example](https://timeseriesai.github.io/tsai/models.TabModel.html).\n\n## How to contribute to tsai?\n\nWe welcome contributions of all kinds. Development of enhancements, bug\nfixes, documentation, tutorial notebooks, …\n\nWe have created a guide to help you start contributing to tsai. You can\nread it\n[here](https://github.com/timeseriesAI/tsai/blob/main/CONTRIBUTING.md).\n\n## Enterprise support and consulting services:\n\nWant to make the most out of timeseriesAI/tsai in a professional\nsetting? Let us help. Send us an email to learn more:\ninfo@timeseriesai.co\n\n## Citing tsai\n\nIf you use tsai in your research please use the following BibTeX entry:\n\n``` text\n@Misc{tsai,\n    author =       {Ignacio Oguiza},\n    title =        {tsai - A state-of-the-art deep learning library for time series and sequential data},\n    howpublished = {Github},\n    year =         {2023},\n    url =          {https://github.com/timeseriesAI/tsai}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimeseriesai%2Ftsai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimeseriesai%2Ftsai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimeseriesai%2Ftsai/lists"}