pmdarima

A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.

https://github.com/alkaline-ml/pmdarima

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.3%) to scientific vocabulary

Keywords

arima econometrics forecasting forecasting-models machine-learning pmdarima python sarimax time-series
Last synced: 6 months ago · JSON representation ·

Repository

A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.

Basic Info
Statistics
  • Stars: 1,668
  • Watchers: 36
  • Forks: 247
  • Open Issues: 73
  • Releases: 44
Topics
arima econometrics forecasting forecasting-models machine-learning pmdarima python sarimax time-series
Created almost 9 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Authors

README.md

pmdarima

PyPI version CircleCI Github Actions Status codecov Supported versions Downloads Downloads/Week

Pmdarima (originally pyramid-arima, for the anagram of 'py' + 'arima') is a statistical library designed to fill the void in Python's time series analysis capabilities. This includes:

  • The equivalent of R's auto.arima functionality
  • A collection of statistical tests of stationarity and seasonality
  • Time series utilities, such as differencing and inverse differencing
  • Numerous endogenous and exogenous transformers and featurizers, including Box-Cox and Fourier transformations
  • Seasonal time series decompositions
  • Cross-validation utilities
  • A rich collection of built-in time series datasets for prototyping and examples
  • Scikit-learn-esque pipelines to consolidate your estimators and promote productionization

Pmdarima wraps statsmodels under the hood, but is designed with an interface that's familiar to users coming from a scikit-learn background.

Installation

pip

Pmdarima has binary and source distributions for Windows, Mac and Linux (manylinux) on pypi under the package name pmdarima and can be downloaded via pip:

bash pip install pmdarima

conda

Pmdarima also has Mac and Linux builds available via conda and can be installed like so:

bash conda config --add channels conda-forge conda config --set channel_priority strict conda install pmdarima

Note: We do not maintain our own Conda binaries, they are maintained at https://github.com/conda-forge/pmdarima-feedstock. See that repo for further documentation on working with Pmdarima on Conda.

Quickstart Examples

Fitting a simple auto-ARIMA on the wineind dataset:

```python import pmdarima as pm from pmdarima.modelselection import traintest_split import numpy as np import matplotlib.pyplot as plt

Load/split your data

y = pm.datasets.loadwineind() train, test = traintestsplit(y, trainsize=150)

Fit your model

model = pm.auto_arima(train, seasonal=True, m=12)

make your forecasts

forecasts = model.predict(test.shape[0]) # predict N steps into the future

Visualize the forecasts (blue=train, green=forecasts)

x = np.arange(y.shape[0]) plt.plot(x[:150], train, c='blue') plt.plot(x[150:], forecasts, c='green') plt.show() ```

Wineind example

Fitting a more complex pipeline on the sunspots dataset, serializing it, and then loading it from disk to make predictions:

```python import pmdarima as pm from pmdarima.modelselection import traintest_split from pmdarima.pipeline import Pipeline from pmdarima.preprocessing import BoxCoxEndogTransformer import pickle

Load/split your data

y = pm.datasets.loadsunspots() train, test = traintestsplit(y, trainsize=2700)

Define and fit your pipeline

pipeline = Pipeline([ ('boxcox', BoxCoxEndogTransformer(lmbda2=1e-6)), # lmbda2 avoids negative values ('arima', pm.AutoARIMA(seasonal=True, m=12, suppress_warnings=True, trace=True)) ])

pipeline.fit(train)

Serialize your model just like you would in scikit:

with open('model.pkl', 'wb') as pkl: pickle.dump(pipeline, pkl)

Load it and make predictions seamlessly:

with open('model.pkl', 'rb') as pkl: mod = pickle.load(pkl) print(mod.predict(15))

[25.20580375 25.05573898 24.4263037 23.56766793 22.67463049 21.82231043

21.04061069 20.33693017 19.70906027 19.1509862 18.6555793 18.21577243

17.8250318 17.47750614 17.16803394]

```

Availability

pmdarima is available on PyPi in pre-built Wheel files for Python 3.9+ for the following platforms:

  • Mac (64-bit)
  • Linux (64-bit manylinux)
  • Windows (64-bit)
    • 32-bit wheels are available for pmdarima versions below 2.0.0 and Python versions below 3.10

If a wheel doesn't exist for your platform, you can still pip install and it will build from the source distribution tarball, however you'll need cython>=0.29 and gcc (Mac/Linux) or MinGW (Windows) in order to build the package from source.

Note that legacy versions (<1.0.0) are available under the name "pyramid-arima" and can be pip installed via:

```bash

Legacy warning:

$ pip install pyramid-arima

python -c 'import pyramid;'

```

However, this is not recommended.

Documentation

All of your questions and more (including examples and guides) can be answered by the pmdarima documentation. If not, always feel free to file an issue.

Owner

  • Name: alkaline-ml
  • Login: alkaline-ml
  • Kind: organization
  • Location: Plano, TX

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you would like to include pmdarima in your published work, please cite it as follows"
authors:
- family-names: "Smith"
  given-names: "Taylor G."
keywords:
  - python
  - "machine learning"
  - "time series"
  - econometrics
  - forecasting
  - arima
  - "forecasting models"
  - sarimax
title: "pmdarima"
version: 2.0.4
date-released: 2023-10-23
license: MIT
repository-artifact: https://pypi.org/project/pmdarima
repository-code: https://github.com/alkaline-ml/pmdarima

GitHub Events

Total
  • Issues event: 6
  • Watch event: 77
  • Delete event: 2
  • Issue comment event: 36
  • Push event: 14
  • Pull request review comment event: 5
  • Pull request event: 5
  • Pull request review event: 5
  • Fork event: 10
  • Create event: 1
Last Year
  • Issues event: 6
  • Watch event: 77
  • Delete event: 2
  • Issue comment event: 36
  • Push event: 14
  • Pull request review comment event: 5
  • Pull request event: 5
  • Pull request review event: 5
  • Fork event: 10
  • Create event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 862
  • Total Committers: 22
  • Avg Commits per committer: 39.182
  • Development Distribution Score (DDS): 0.273
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Taylor Smith t****1@g****m 627
Aaron Smith a****h@g****m 118
charlesdrotar d****s@y****m 64
Aaron Smith a****h@t****m 14
Christopher Siewert c****t@l****a 12
Krishna Sunkara k****a@a****m 6
Gary Foreman g****n@M****l 3
Charles Ross c****y@m****m 2
Max Klein t****n@h****m 2
Ryan Russell r****l 2
Anne DeCusatis a****s 1
Chris Mahoney 4****o 1
Felix Hildén f****n@g****m 1
Mohit Munjal m****7@g****m 1
Tian Wang w****2@g****m 1
ad1729 a****9 1
adubpak 4****k 1
codeananda 5****a 1
Steven Hoelscher s****o@z****m 1
Lucas Schiefelbein c****e@L****l 1
drxyzw h****0@g****m 1
tuomijal j****n@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 94
  • Total pull requests: 52
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 1 month
  • Total issue authors: 87
  • Total pull request authors: 11
  • Average comments per issue: 2.83
  • Average comments per pull request: 0.62
  • Merged pull requests: 42
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 8
  • Pull requests: 2
  • Average time to close issues: about 1 hour
  • Average time to close pull requests: about 1 month
  • Issue authors: 8
  • Pull request authors: 2
  • Average comments per issue: 2.25
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • theabc50111 (2)
  • dilwong (2)
  • BaklazhenkoNikita (2)
  • pmoriano (2)
  • pmgh2345 (2)
  • tobiasderoos (2)
  • RichardFrno (1)
  • harupy (1)
  • eyalshafran (1)
  • jayc-stripe (1)
  • XJTLUmedia (1)
  • joshi-abhishek (1)
  • fkiraly (1)
  • nate-thomas-pillpack (1)
  • VasudevTA (1)
Pull Request Authors
  • aaronreidsmith (40)
  • tgsmith61591 (6)
  • dependabot[bot] (2)
  • fnhirwa (2)
  • ryanrussell (2)
  • chrimaho (2)
  • keyork (1)
  • anne-decusatis (1)
  • odidev (1)
  • Ujjwal-code-py (1)
  • codeananda (1)
Top Labels
Issue Labels
:beetle: : bug (34) :grey_question: : question (31) feature request (13) :information_source: : more info needed (2) v2.0.0 (2) python 3.12 (2) good first issue (1) awaiting-op (1) :confused: : cannot replicate (1) enhancement (1) help wanted (1) duplicate (1) wontfix (1)
Pull Request Labels
doc (7) cicd (6) hold (3) dependency-issue (3) v2.0.0 (2) maintenance (2) python (2) feature request (1) :beetle: :hammer: : bug-fix (1)

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 6,144,450 last-month
  • Total docker downloads: 66,118
  • Total dependent packages: 58
    (may contain duplicates)
  • Total dependent repositories: 835
    (may contain duplicates)
  • Total versions: 72
  • Total maintainers: 2
pypi.org: pmdarima

Python's forecast::auto.arima equivalent

  • Versions: 27
  • Dependent Packages: 50
  • Dependent Repositories: 819
  • Downloads: 6,144,450 Last month
  • Docker Downloads: 66,118
Rankings
Downloads: 0.2%
Dependent packages count: 0.3%
Dependent repos count: 0.4%
Docker downloads count: 0.8%
Average: 1.2%
Stargazers count: 1.8%
Forks count: 3.4%
Maintainers (2)
Last synced: 6 months ago
proxy.golang.org: github.com/alkaline-ml/pmdarima
  • Versions: 33
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
conda-forge.org: pmdarima
  • Versions: 9
  • Dependent Packages: 5
  • Dependent Repositories: 8
Rankings
Dependent packages count: 10.4%
Stargazers count: 10.9%
Average: 11.3%
Forks count: 11.9%
Dependent repos count: 12.1%
Last synced: 6 months ago
anaconda.org: pmdarima

Pmdarima (originally pyramid-arima, for the anagram of 'py' + 'arima') is a statistical library designed to fill the void in Python's time series analysis capabilities.

  • Versions: 3
  • Dependent Packages: 3
  • Dependent Repositories: 8
Rankings
Stargazers count: 20.6%
Dependent packages count: 21.5%
Forks count: 21.8%
Average: 25.8%
Dependent repos count: 39.4%
Last synced: 6 months ago

Dependencies

.github/workflows/badges.yml actions
  • actions/checkout master composite
  • actions/setup-python v2 composite
.github/workflows/build_and_deploy.yml actions
  • actions/checkout master composite
  • actions/setup-python v3 composite
  • docker/setup-qemu-action v1 composite
.github/workflows/nightly_cron.yml actions
  • 8398a7/action-slack v3 composite
  • actions/checkout master composite
  • actions/setup-python v3 composite
  • actions/setup-python v2 composite
.github/workflows/test_tagging.yml actions
  • actions/checkout master composite
  • actions/setup-python v2 composite
build_tools/build_requirements.txt pypi
  • cython >=0.29,
  • matplotlib *
  • numpy ==1.21.6
  • numpy ==1.23.2
  • numpy ==1.21.2
  • numpy ==1.22.3
  • pandas >=0.19
  • patsy *
  • pytest *
  • pytest-benchmark *
  • pytest-mpl *
  • readme_renderer *
  • scikit-learn >=0.22
  • scipy ==1.5.4
  • scipy ==1.5.3
  • scipy ==1.7.2
  • scipy ==1.3.2
  • scipy ==1.9.3
  • setuptools >=38.6.0,
  • statsmodels >=0.11,
  • twine >=1.13.0
  • urllib3 *
  • wheel *
requirements.txt pypi
  • Cython >=0.29,
  • joblib >=0.11
  • numpy >=1.21.2
  • pandas >=0.19
  • scikit-learn >=0.22
  • scipy >=1.3.2
  • setuptools >=38.6.0,
  • statsmodels >=0.13.2
  • urllib3 *