Skip to main content

Python's forecast::auto.arima equivalent

Project description

pmdarima

PyPI version CircleCI Build Status 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

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:

$ pip install pmdarima

Conda distributions are also available for Windows (64-bit only), Mac and Linux using Python 3.6 or 3.7:

$ conda install -c alkaline-ml pmdarima

Quickstart Examples

Fitting a simple auto-ARIMA on the wineind dataset:

import pmdarima as pm
from pmdarima.model_selection import train_test_split
import numpy as np
import matplotlib.pyplot as plt

# Load/split your data
y = pm.datasets.load_wineind()
train, test = train_test_split(y, train_size=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:

import pmdarima as pm
from pmdarima.model_selection import train_test_split
from pmdarima.pipeline import Pipeline
from pmdarima.preprocessing import BoxCoxEndogTransformer
import pickle

# Load/split your data
y = pm.datasets.load_sunspots()
train, test = train_test_split(y, train_size=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.5+ for the following platforms:

  • Mac (64-bit)
  • Linux (64-bit manylinux)
  • Windows (32 & 64-bit)

It is also available on conda for Python 3.6 and 3.7 for the following platforms:

  • Mac (64-bit)
  • Linux (64-bit)
  • Windows (64-bit)

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:

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmdarima-1.5.3.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pmdarima-1.5.3-cp38-cp38-win_amd64.whl (601.7 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.5.3-cp38-cp38-win32.whl (541.4 kB view details)

Uploaded CPython 3.8Windows x86

pmdarima-1.5.3-cp38-cp38-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8

pmdarima-1.5.3-cp38-cp38-macosx_10_15_x86_64.whl (606.2 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.5.3-cp37-cp37m-win_amd64.whl (595.6 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.5.3-cp37-cp37m-win32.whl (537.8 kB view details)

Uploaded CPython 3.7mWindows x86

pmdarima-1.5.3-cp37-cp37m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7m

pmdarima-1.5.3-cp37-cp37m-macosx_10_15_x86_64.whl (601.3 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.5.3-cp36-cp36m-win_amd64.whl (595.4 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.5.3-cp36-cp36m-win32.whl (537.7 kB view details)

Uploaded CPython 3.6mWindows x86

pmdarima-1.5.3-cp36-cp36m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6m

pmdarima-1.5.3-cp36-cp36m-macosx_10_15_x86_64.whl (601.4 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

pmdarima-1.5.3-cp35-cp35m-win_amd64.whl (568.4 kB view details)

Uploaded CPython 3.5mWindows x86-64

pmdarima-1.5.3-cp35-cp35m-win32.whl (516.8 kB view details)

Uploaded CPython 3.5mWindows x86

pmdarima-1.5.3-cp35-cp35m-manylinux1_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.5m

pmdarima-1.5.3-cp35-cp35m-macosx_10_15_x86_64.whl (595.8 kB view details)

Uploaded CPython 3.5mmacOS 10.15+ x86-64

File details

Details for the file pmdarima-1.5.3.tar.gz.

File metadata

  • Download URL: pmdarima-1.5.3.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pmdarima-1.5.3.tar.gz
Algorithm Hash digest
SHA256 8ba38c094abe465afa96f1720f3f7a0830074f3514c44c4bf7d7bf91be8411a8
MD5 25d67db47d735c3e76ece47405c44fa0
BLAKE2b-256 3ab493e465fc399aeb2b8c5a9e4e58de6c82a2bd74b03a0e32e1a56b93dc955e

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 601.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pmdarima-1.5.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 112b8cec5e02754a090d6cab881caeddacc5fcd0cbbe0fd51dfc039970d43496
MD5 70c0b5a14bc63be1e5653644252c2a11
BLAKE2b-256 5e4d7319622398fb4995a6380cf505d121a6acd1ac11cf02c0973bef4cadf704

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp38-cp38-win32.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 541.4 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pmdarima-1.5.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 9940c400ba62693596709d418d34875ad23f3ff5e61e445acc934eabbf58b633
MD5 e1f77226d1418e285f6b8f20e9697361
BLAKE2b-256 5c29d91075eb107d4574528e2499d21af0271a810a9e7e7880d59d3a7d6223c7

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pmdarima-1.5.3-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9500480cfc2d1b583533bd6867036690f72a6d19258e9d7e75ea3a4470a4924e
MD5 14d3bfd76ab4e5397883889de3f16252
BLAKE2b-256 758bb0fc418b08351604a7e4becb1f6c1513149b4e1994e083713d14c046e877

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 606.2 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pmdarima-1.5.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3822e76d3745a40608a37de48ac161ca02a6bcb9c9ddb1e8d8391333dd3a3ec6
MD5 94ccbaaa8f2eace81ea454e629ec4b57
BLAKE2b-256 693b6adfff3722052e38806208b72b7c423123f8816944549479922748f0b9b2

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 595.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pmdarima-1.5.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6ad3b25e6700209a3a5befcee7af20e32dcd9730cc991cf91e4cc231089e7d52
MD5 ee48b818ed3451aa6edaa35bbc3fae69
BLAKE2b-256 b1b71bfb5acff4c4cc8fdcc7ca816ee6bfd6a573672d5194ee11859a7ca384b4

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 537.8 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pmdarima-1.5.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 5daa8e7cd6c5361aa8fcb15cf69aa5abb52a6ab9f66e5f4c8a824ecc6ad5f428
MD5 3ff0336b338d5998270984df9e60edff
BLAKE2b-256 08383e4aedf61320347a436bedb85f216450348d529d81e41d9157fd51970ed4

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pmdarima-1.5.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3cf08d237c989065bd2b8bc21950df7ad920829cf8eb763aecb4221716d39619
MD5 509a1abbdd97d603e2c68042f9144b0d
BLAKE2b-256 3607ef858dc6b9c4240aa4e676927a6704f1f970a1226e7a89c411e243302de3

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 601.3 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pmdarima-1.5.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a97e7937efef2dad632638cd8ed2a0ad498a36b3a9fdafb3b06bba88bcb6b6cc
MD5 62d8fb6f0f09d6ac90dc38bd2f40f000
BLAKE2b-256 02bc7a984c74719596308611d502b3b375a82927e6103c8f8d40f0365da1dcc9

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 595.4 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.8

File hashes

Hashes for pmdarima-1.5.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 54f62ed87e268afaeae6864715969412a956add40f8b5152fbb0695599fdd297
MD5 5c95696c650f02299ce69d1b8c743a90
BLAKE2b-256 e2e19d9a2da138e71d5245c34efb37d9be6d51507f12e0dba3f658157fd191bf

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 537.7 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.8

File hashes

Hashes for pmdarima-1.5.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 1b90fc0cc534e6f0682e2240f9b3fadb3d86fd9786dd09522913b9f69e7f64e0
MD5 a44e75b56da7db41f620f1345e9e246e
BLAKE2b-256 fcd86f6dd6cab5dc76a376b2146f00b9fb244ff29f2598cbc11b0c2a9d947da8

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pmdarima-1.5.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 294c5d4e5ec2d7b73e58aea12c5bdcd96dd980ab8e2d0abb30555a02a1f273d0
MD5 e9d159fa13ade40c7f1b21ed45d17be9
BLAKE2b-256 83aafeb76414043592c3149059ab772a51de03fbf7544a8e19237f229a50a949

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 601.4 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10

File hashes

Hashes for pmdarima-1.5.3-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1037f1542190467b4e5b289631edfc36ddc3dbcb03f53b2cef7a0941b156c760
MD5 a1067bb256b75e90e0732b10a6f1b1f3
BLAKE2b-256 b2f0dafa58329b853a2c62aa7f142cbc3c38f764ccd3be8257a136767a372e03

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 568.4 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.5.4

File hashes

Hashes for pmdarima-1.5.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 d56c318b4e3a37b4b32223b58bf97552111241d37908dcbab68d3b5d81795f12
MD5 9c615d4ec47dd25a1b2cc285e03e5546
BLAKE2b-256 8c73fa93f455688f697a98fe598f4032f347fc8ed97d39cf48e7ef1a15c86097

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp35-cp35m-win32.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 516.8 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.5.4

File hashes

Hashes for pmdarima-1.5.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 6589b47995431941aa92b2ee85e5af153632392c9467588c2037f4d4fccfbbe8
MD5 9e332a5f3175065460a36c7ce6b3bdaf
BLAKE2b-256 c26a16d9f21668d6636b150e4c0898bd9101aecb5e0a7e69b6611d697ada48b1

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pmdarima-1.5.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 06f57508e389346ac1b9bf6d894337ff8d8e89b75676d2671609f79d13799ffa
MD5 b33e78f5a768441a26bf1acd1ae86993
BLAKE2b-256 baadc6fe6d213b348de57114a7982074f45a552c733e5f0cc3095270aee9b018

See more details on using hashes here.

File details

Details for the file pmdarima-1.5.3-cp35-cp35m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.5.3-cp35-cp35m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 595.8 kB
  • Tags: CPython 3.5m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.5.9

File hashes

Hashes for pmdarima-1.5.3-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 58d2bdd672ed34f74ac5050c4cd6a9a77122fa3f6295e6b0c66e051f8ae28d60
MD5 642a48d29bba1adcd5d076e613d4f9ac
BLAKE2b-256 05f51822b81e2ed011b3e54165e3a8259cfef8bca0dbf5e3c27bcf278f7a173d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page