kats

Kats, a kit to analyze time series data, a lightweight, easy-to-use, generalizable, and extendable framework to perform time series analysis, from understanding the key statistics and characteristics, detecting change points and anomalies, to forecasting future trends.

https://github.com/facebookresearch/kats

Science Score: 44.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Kats, a kit to analyze time series data, a lightweight, easy-to-use, generalizable, and extendable framework to perform time series analysis, from understanding the key statistics and characteristics, detecting change points and anomalies, to forecasting future trends.

Basic Info
  • Host: GitHub
  • Owner: facebookresearch
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 34.2 MB
Statistics
  • Stars: 6,172
  • Watchers: 83
  • Forks: 618
  • Open Issues: 66
  • Releases: 2
Created about 5 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

Github Actions PyPI Version PRs Welcome

Description

Kats is a toolkit to analyze time series data, a lightweight, easy-to-use, and generalizable framework to perform time series analysis. Time series analysis is an essential component of Data Science and Engineering work at industry, from understanding the key statistics and characteristics, detecting regressions and anomalies, to forecasting future trends. Kats aims to provide the one-stop shop for time series analysis, including detection, forecasting, feature extraction/embedding, multivariate analysis, etc.

Kats is released by Facebook's Infrastructure Data Science team. It is available for download on PyPI.

Important links

  • Homepage: https://facebookresearch.github.io/Kats/
  • Kats Python package: https://pypi.org/project/kats/
  • Facebook Engineering Blog Post: https://engineering.fb.com/2021/06/21/open-source/kats/
  • Source code repository: https://github.com/facebookresearch/kats
  • Contributing: https://github.com/facebookresearch/Kats/blob/master/CONTRIBUTING.md
  • Tutorials: https://github.com/facebookresearch/Kats/tree/master/tutorials

Installation in Python

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

bash pip install --upgrade pip pip install kats

If you need only a small subset of Kats, you can install a minimal version of Kats with bash MINIMAL_KATS=1 pip install kats which omits many dependencies (everything in test_requirements.txt). However, this will disable many functionalities and cause import kats to log warnings. See setup.py for full details and options.

Examples

Here are a few sample snippets from a subset of Kats offerings:

Forecasting

Using Prophet model to forecast the air_passengers data set.

```python import pandas as pd

from kats.consts import TimeSeriesData from kats.models.prophet import ProphetModel, ProphetParams

take air_passengers data as an example

airpassengersdf = pd.readcsv( "../kats/data/airpassengers.csv", header=0, names=["time", "passengers"], )

convert to TimeSeriesData object

airpassengersts = TimeSeriesData(airpassengersdf)

create a model param instance

params = ProphetParams(seasonality_mode='multiplicative') # additive mode gives worse results

create a prophet model instance

m = ProphetModel(airpassengersts, params)

fit model simply by calling m.fit()

m.fit()

make prediction for next 30 month

fcst = m.predict(steps=30, freq="MS") ```

Detection

Using CUSUM detection algorithm on simulated data set.

```python

import packages

import numpy as np import pandas as pd

from kats.consts import TimeSeriesData from kats.detectors.cusum_detection import CUSUMDetector

simulate time series with increase

np.random.seed(10) dfincrease = pd.DataFrame( { 'time': pd.daterange('2019-01-01', '2019-03-01'), 'increase':np.concatenate([np.random.normal(1,0.2,30), np.random.normal(2,0.2,30)]), } )

convert to TimeSeriesData object

timeseries = TimeSeriesData(df_increase)

run detector and find change points

change_points = CUSUMDetector(timeseries).detector() ```

TSFeatures

We can extract meaningful features from the given time series data

```python

Initiate feature extraction class

import pandas as pd from kats.consts import TimeSeriesData from kats.tsfeatures.tsfeatures import TsFeatures

take air_passengers data as an example

airpassengersdf = pd.readcsv( "../kats/data/airpassengers.csv", header=0, names=["time", "passengers"], )

convert to TimeSeriesData object

airpassengersts = TimeSeriesData(airpassengersdf)

calculate the TsFeatures

features = TsFeatures().transform(airpassengersts) ```

Citing Kats

If you use Kats in your work or research, please use the following BibTeX entry.

@software{Jiang_KATS_2022, author = {Jiang, Xiaodong and Srivastava, Sudeep and Chatterjee, Sourav and Yu, Yang and Handler, Jeffrey and Zhang, Peiyi and Bopardikar, Rohan and Li, Dawei and Lin, Yanjun and Thakore, Uttam and Brundage, Michael and Holt, Ginger and Komurlu, Caner and Nagalla, Rakshita and Wang, Zhichao and Sun, Hechao and Gao, Peng and Cheung, Wei and Gao, Jun and Wang, Qi and Guerard, Marius and Kazemi, Morteza and Chen, Yulin and Zhou, Chong and Lee, Sean and Laptev, Nikolay and Levendovszky, Tihamér and Taylor, Jake and Qian, Huijun and Zhang, Jian and Shoydokova, Aida and Singh, Trisha and Zhu, Chengjun and Baz, Zeynep and Bergmeir, Christoph and Yu, Di and Koylan, Ahmet and Jiang, Kun and Temiyasathit, Ploy and Yurtbay, Emre}, license = {MIT License}, month = {3}, title = {{Kats}}, url = {https://github.com/facebookresearch/Kats}, version = {0.2.0}, year = {2022} }

Changelog

Version 0.2.0

  • Forecasting
    • Added global model, a neural network forecasting model
    • Added global model tutorial
    • Consolidated backtesting APIs and some minor bug fixes
  • Detection
    • Added model optimizer for anomaly/ changepoint detection
    • Added evaluators for anomaly/changepoint detection
    • Improved simulators, to build synthetic data and inject anomalies
    • Added new detectors: ProphetTrendDetector, Dynamic Time Warping based detectors
    • Support for meta-learning, to recommend anomaly detection algorithms and parameters for your dataset
    • Standardized API for some of our legacy detectors: OutlierDetector, MKDetector
    • Support for Seasonality Removal in StatSigDetector
  • TsFeatures
    • Added time-based features
  • Others
    • Bug fixes, code coverage improvement, etc.

Version 0.1.0

  • Initial release

Contributors

Kats is currentely maintaned by community with the main contributions and leading from Nickolai Kniazev and Peter Shaffery

Kats is a project with several skillful researchers and engineers contributing to it. Kats was started and built by Xiaodong Jiang with major contributions coming from many talented individuals in various forms and means. A non-exhaustive but growing list needs to mention: Sudeep Srivastava, Sourav Chatterjee, Jeff Handler, Rohan Bopardikar, Dawei Li, Yanjun Lin, Yang Yu, Michael Brundage, Caner Komurlu, Rakshita Nagalla, Zhichao Wang, Hechao Sun, Peng Gao, Wei Cheung, Jun Gao, Qi Wang, Morteza Kazemi, Tihamér Levendovszky, Jian Zhang, Ahmet Koylan, Kun Jiang, Aida Shoydokova, Ploy Temiyasathit, Sean Lee, Nikolay Pavlovich Laptev, Peiyi Zhang, Emre Yurtbay, Daniel Dequech, Rui Yan, William Luo, Marius Guerard, Pietari Pulkkinen, Uttam Thakore, Trisha Singh, Huijun Qian, Chengjun Zhu, Di Yu, Zeynep Erkin Baz, and Christoph Bergmeir.

License

Kats is licensed under the MIT license.

Owner

  • Name: Meta Research
  • Login: facebookresearch
  • Kind: organization
  • Location: Menlo Park, California

Citation (CITATION.cff)

cff-version: 0.1.0
title: Kats
message: >-
  If you use this library, please cite using the
  following metadata.
type: software
authors:
  - given-names: Xiaodong
    email: iamxiaodong@meta.com
    family-names: Jiang
    affiliation: Meta
  - given-names: Sudeep
    email: sudeeps@meta.com
    family-names: Srivastava
    affiliation: Meta
  - given-names: Sourav
    email: souravc83@meta.com
    family-names: Chatterjee
    affiliation: Meta
  - given-names: Yang
    email: yangbk@meta.com
    family-names: Yu
    affiliation: Meta
  - given-names: Jeffrey
    email: jeffhandl@meta.com
    family-names: Handler
    affiliation: Meta
  - given-names: Peiyi
    email: peiyizhang@meta.com
    family-names: Zhang
    affiliation: Meta
  - given-names: Rohan
    # email:
    family-names: Bopardikar
    affiliation: Meta
  - given-names: Dawei
    # email:
    family-names: Li
    affiliation: Apple
  - given-names: Yanjun
    # email:
    family-names: Lin
    affiliation: Meta
  - given-names: Uttam
    email: uthakore@meta.com
    family-names: Thakore
    affiliation: Meta
  - given-names: Michael
    # email:
    family-names: Brundage
    affiliation: Meta
  - given-names: Ginger
    # email:
    family-names: Holt
    affiliation: Databricks
  - given-names: Caner
    # email:
    family-names: Komurlu
    affiliation: Somatus
  - given-names: Rakshita
    # email:
    family-names: Nagalla
    affiliation: LinkedIn
  - given-names: Zhichao
    # email:
    family-names: Wang
    affiliation: Doordash
  - given-names: Hechao
    # email:
    family-names: Sun
    affiliation: Instacart
  - given-names: Peng
    # email:
    family-names: Gao
    affiliation: Meta
  - given-names: Wei
    # email:
    family-names: Cheung
    affiliation: Meta
  - given-names: Jun
    # email:
    family-names: Gao
    affiliation: Meta
  - given-names: Qi
    # email:
    family-names: Wang
    affiliation: Meta
  - given-names: Marius
    # email:
    family-names: Guerard
    affiliation: Google
  - given-names: Morteza
    email:
    family-names: Kazemi
    # affiliation:
  - given-names: Yulin
    # email:
    family-names: Chen
    affiliation: Meta
  - given-names: Chong
    # email:
    family-names: Zhou
    affiliation: Meta
  - given-names: Sean
    email: seunghak@meta.com
    family-names: Lee
    affiliation: Meta
  - given-names: Nikolay
    # email:
    family-names: Laptev
    affiliation: Meta
  - given-names: Tihamér
    # email:
    family-names: Levendovszky
    affiliation: Meta
  - given-names: Jake
    # email:
    family-names: Taylor
    affiliation: Meta
  - given-names: Huijun
    # email:
    family-names: Qian
    affiliation: Meta
  - given-names: Jian
    # email:
    family-names: Zhang
    affiliation: Meta
  - given-names: Aida
    # email:
    family-names: Shoydokova
    affiliation: Meta
  - given-names: Trisha
    # email:
    family-names: Singh
    affiliation: Meta
  - given-names: Chengjun
    # email:
    family-names: Zhu
    affiliation: Meta
  - given-names: Zeynep
    # email:
    family-names: Baz
    affiliation: Meta
  - given-names: Christoph
    # email:
    family-names: Bergmeir
    affiliation: Monash University
  - given-names: Di
    # email:
    family-names: Yu
    affiliation: Meta
  - given-names: Ahmet
    # email:
    family-names: Koylan
    # affiliation:
  - given-names: Kun
    # email:
    family-names: Jiang
    affiliation: Meta
  - given-names: Ploy
    # email:
    family-names: Temiyasathit
    affiliation: Graphcore
  - given-names: Emre
    # email:
    family-names: Yurtbay
    affiliation: Meta
repository-code: 'https://github.com/facebookresearch/Kats'
abstract: >-
  Kats is a toolkit to analyze time series data, a lightweight, easy-to-use,
  and generalizable framework to perform time series analysis. Time series
  analysis is an essential component of Data Science and Engineering work
  at industry, from understanding the key statistics and characteristics,
  detecting regressions and anomalies, to forecasting future trends.
  Kats aims to provide the one-stop shop for time series analysis,
  including detection, forecasting, feature extraction/embedding,
  multivariate analysis, etc.
keywords:
  - 'Kats, time series, forecasting, detection, embedding'
license: MIT License
license-url: https://github.com/facebookresearch/Kats/blob/main/LICENSE
version: '0.2.0'
date-released: '2022-03-15'
identifiers:
  - type: url
    value: "https://github.com/facebookresearch/Kats/releases/tag/v0.2.0"
    description: The GitHub release URL of tag 0.2.0

GitHub Events

Total
  • Commit comment event: 1
  • Issues event: 6
  • Watch event: 1,134
  • Issue comment event: 24
  • Push event: 36
  • Pull request event: 7
  • Fork event: 81
Last Year
  • Commit comment event: 1
  • Issues event: 6
  • Watch event: 1,134
  • Issue comment event: 24
  • Push event: 36
  • Pull request event: 7
  • Fork event: 81

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 799
  • Total Committers: 155
  • Avg Commits per committer: 5.155
  • Development Distribution Score (DDS): 0.849
Past Year
  • Commits: 48
  • Committers: 20
  • Avg Commits per committer: 2.4
  • Development Distribution Score (DDS): 0.688
Top Committers
Name Email Commits
Michael Brundage b****e@f****m 121
Jeffrey Handler j****l@f****m 64
Xiaodong Jiang i****g@f****m 49
Peiyi Zhang p****g@m****m 45
Uttam Thakore u****e@f****m 34
Nick Knize k****z@m****m 33
Rohan Bopardikar r****b@f****m 32
Peiyi Zhang p****g@f****m 30
Yang Yu y****k@f****m 27
Facebook Community Bot f****t 26
Pyre Bot Jr 23
Ivan Slijepcevic i****l@m****m 15
Dawei Li t****3@f****m 12
Marius Guerard m****d@f****m 11
Yang Yu y****k@m****m 11
generatedunixname89002005307016 g****6@m****m 11
Peter Shaffery p****y@m****m 9
Aida Shoydokova a****h@f****m 8
Sourav Chatterjee s****3@f****m 8
Jake Taylor j****r@m****m 8
Bhavin Atulbhai Shah b****h@f****m 8
ourownstory o****y 7
Daniel Almeida Dequech d****h@f****m 7
Yang 8****0 6
Yanjun Lin y****n@f****m 6
Bhavin Atulbhai Shah b****h@m****m 5
Ahmet Koylan a****n@f****m 5
generatedunixname89002005307016 g****6@f****m 5
Miles Olson m****4@m****m 5
Jon Janzen j****n@f****m 5
and 125 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 95
  • Total pull requests: 50
  • Average time to close issues: 4 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 81
  • Total pull request authors: 26
  • Average comments per issue: 2.12
  • Average comments per pull request: 1.4
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Issue authors: 5
  • Pull request authors: 4
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.13
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • nebiyebulan (5)
  • AnyCPU (3)
  • ali-Eskandarian (3)
  • brianbhsu (3)
  • yannmean (2)
  • psxpa3 (2)
  • candalfigomoro (2)
  • grantjenks (1)
  • Rachit-Gandhi (1)
  • xiaogangzhu (1)
  • wenshutang (1)
  • fkiraly (1)
  • LumingSun (1)
  • Antorminator (1)
  • KansaiUser (1)
Pull Request Authors
  • facebook-github-bot (10)
  • adamantike (4)
  • mpolson64 (4)
  • irumata (3)
  • Fanuel-D (2)
  • muthusaravanas (2)
  • jeffhandl (2)
  • MoKazemi9 (2)
  • monoluage (2)
  • waqarahmed6095 (2)
  • lena-kashtelyan (2)
  • proof-by-accident (2)
  • yangbk560 (1)
  • rohanfb (1)
  • rpanai (1)
Top Labels
Issue Labels
metalearning (2) globalmodel (1) ensemble (1)
Pull Request Labels
CLA Signed (41) fh:direct-merge-enabled (10) fb-exported (9) Merged (7)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 12,724 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 13
    (may contain duplicates)
  • Total versions: 5
  • Total maintainers: 1
pypi.org: kats

kats: kit to analyze time series

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 13
  • Downloads: 12,724 Last month
  • Docker Downloads: 0
Rankings
Stargazers count: 1.0%
Downloads: 1.9%
Forks count: 2.3%
Average: 3.9%
Dependent repos count: 4.0%
Docker downloads count: 4.2%
Dependent packages count: 10.0%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/facebookresearch/kats
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago
conda-forge.org: kats

Kats is a toolkit to analyze time series data, a lightweight, easy-to-use, and generalizable framework to perform time series analysis. Time series analysis is an essential component of Data Science and Engineering work at industry, from understanding the key statistics and characteristics, detecting regressions and anomalies, to forecasting future trends. Kats aims to provide the one-stop shop for time series analysis, including detection, forecasting, feature extraction/embedding, multivariate analysis, etc.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 5.0%
Forks count: 7.3%
Average: 24.4%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

.github/workflows/build_and_test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
requirements.txt pypi
  • attrs >=21.2.0
  • deprecated >=1.2.12
  • importlib_metadata *
  • matplotlib >=2.0.0
  • numpy >=1.21,<1.22
  • packaging <22
  • pandas >=1.0.4,<=1.3.5
  • python-dateutil >=2.8.0
  • scikit-learn >=0.24.2
  • scipy <1.8.0
  • seaborn >=0.11.1
  • setuptools-git >=1.2
  • statsmodels ==0.12.2
  • typing-extensions *
test_requirements.txt pypi
  • LunarCalendar >=0.0.9 test
  • ax-platform ==0.2.9 test
  • fbprophet ==0.7.1 test
  • gpytorch <1.9.0 test
  • holidays >=0.10.2 test
  • neuralprophet ==0.3.2 test
  • numba >=0.52.0 test
  • parameterized >=0.8.1 test
  • plotly >=2.2.1 test
  • pymannkendall >=1.4.1 test
  • pystan ==2.19.1.1 test
  • pytest-mpl >=0.12,<0.16 test
  • torch * test
  • tqdm >=4.36.1 test
setup.py pypi