Skip to main content

Python's forecast::auto.arima equivalent

Project description

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:

pip install pmdarima

conda

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

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:

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.6+ for the following platforms:

  • Mac (64-bit)
  • Linux (64-bit manylinux)
  • Windows (32 & 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.8.3.tar.gz (638.8 kB view details)

Uploaded Source

Built Distributions

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

pmdarima-1.8.3-cp39-cp39-win_amd64.whl (600.4 kB view details)

Uploaded CPython 3.9Windows x86-64

pmdarima-1.8.3-cp39-cp39-win32.whl (550.5 kB view details)

Uploaded CPython 3.9Windows x86

pmdarima-1.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.24+ x86-64

pmdarima-1.8.3-cp39-cp39-macosx_10_15_x86_64.whl (603.3 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

pmdarima-1.8.3-cp38-cp38-win_amd64.whl (600.3 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.8.3-cp38-cp38-win32.whl (549.8 kB view details)

Uploaded CPython 3.8Windows x86

pmdarima-1.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.24+ x86-64

pmdarima-1.8.3-cp38-cp38-macosx_10_15_x86_64.whl (595.2 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.8.3-cp37-cp37m-win_amd64.whl (594.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.8.3-cp37-cp37m-win32.whl (545.3 kB view details)

Uploaded CPython 3.7mWindows x86

pmdarima-1.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.24+ x86-64

pmdarima-1.8.3-cp37-cp37m-macosx_10_15_x86_64.whl (595.2 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.8.3-cp36-cp36m-win_amd64.whl (595.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.8.3-cp36-cp36m-win32.whl (544.9 kB view details)

Uploaded CPython 3.6mWindows x86

pmdarima-1.8.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.24+ x86-64

pmdarima-1.8.3-cp36-cp36m-macosx_10_15_x86_64.whl (594.5 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-1.8.3.tar.gz
  • Upload date:
  • Size: 638.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pmdarima-1.8.3.tar.gz
Algorithm Hash digest
SHA256 a252ef19359d418aec5ebaeb76832c1934b4b680446bad46cdbf26775eb840a8
MD5 77ffbc1dc497cc4134a6a842ff148b55
BLAKE2b-256 2e7920accf0f04cdca2b5917c8c6c903b3fa68980af27e0531ee2be4c4007548

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pmdarima-1.8.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 600.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pmdarima-1.8.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a7e042ce9e510e76fde681101e26125dfd65fdada77cce22f7b68f62834e30a2
MD5 77788e3b318d57617bc9e7dc649d2bd5
BLAKE2b-256 a97f30aca5a3afa4426463d4fedd4520be48ee5803b3e84e3119985c845e54b1

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.3-cp39-cp39-win32.whl.

File metadata

  • Download URL: pmdarima-1.8.3-cp39-cp39-win32.whl
  • Upload date:
  • Size: 550.5 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pmdarima-1.8.3-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 5aedd3bf6bbffd2a37159e20e63dce6cbc90c42c56a4bd225060fa04b8679384
MD5 016540ee91b355d480f3a0a13e217f58
BLAKE2b-256 b871a02adc8deb5a78effb170d97ce0bf6f6df4d15c56475d08cdb93a4dc8f47

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-1.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 dd055b5d95fa5553111b7d9eca9a99559bbfd648422111e09cbf7836de3d90ad
MD5 051e77b95e2ba2fc3f05ce930e55e26f
BLAKE2b-256 383435a044f27865db19c58ea70b02cbcd62f33467429185390d469fe203ea6e

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.3-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.3-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 603.3 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pmdarima-1.8.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bc623424f51d990634913ad38ef9c22915043472e855fde60c96cf5b265046e8
MD5 e4de60fd35dd492223fb967b930e814e
BLAKE2b-256 bc98f24ccb982d494b4b7a3aa3978da400a5c4e2e3e8948fb62a1b8d1b878688

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 600.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pmdarima-1.8.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a3b8f4a0aba3ecd16f6dc70a08eb044b34da7e9bf3c1e41fa1fec2240fa775c1
MD5 4a60b895c6a82a0439c43fcba7758f02
BLAKE2b-256 3ae3094ec5437aee298d18b1586cdb1a7e7889d057346cdf5baf32cf21eadd3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 549.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pmdarima-1.8.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 9b5e6327b96467f62c9f183335960e56f82f33d7e944b25debca52d23804e5b2
MD5 b467be9543c3ff441932aaa4cfcda51e
BLAKE2b-256 d36a88c27cf138f97a845a96f0d92d09cbb77517b430f6253aace6abe9d6bdd6

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-1.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 48472979edc35e7d28005e3bbe451442b50e16c6392f06ede96f814a3fae4520
MD5 934e4a02801e4973e6516721a788fd6e
BLAKE2b-256 f31ab7e51088958aace727bf1b0d9181fefe3e320e68e687b958985ceb9ae1c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 595.2 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for pmdarima-1.8.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ca2efd39f7ffef6e69c33af99c9df50f30271269dca3eb327e229bd7d5ebe4d7
MD5 65cf10ffcd245d7a9dc069f0f6eb8457
BLAKE2b-256 f755155d52c2f44fe1f841233d2feb45c4d86686bb9d4bc82b93c4a8f249f676

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 594.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for pmdarima-1.8.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e31616a638e2f5e4a8222b25f4a8d2ef4b5ee57653d5d60f60e85a7a0277972a
MD5 6674d54d06eb086b77d0b1c2bc916d83
BLAKE2b-256 a0307690cfc83b6c3105c37637b1fa2d54db83eea5f71b41f4957d02deda2a8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 545.3 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for pmdarima-1.8.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 9fde1675f177d548d01c37122790dc842de5b82a62d9f8c43dd6a319159e93ef
MD5 6b2c1973fb37e085d436527f62b346d8
BLAKE2b-256 de625f68ff677b14e9ebfb62fee4200f0ff81e3d9955e332ff82d20442a1be60

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-1.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 b353ea7d21d418b2e0a939eb185b64c1e05b11cb14fa1f2b9e885eb621138a1d
MD5 59315a3eafc1ddbd65a705e3e6a14f4b
BLAKE2b-256 b4bc6ac35248637ba399f03111b905c519bd973a697fdd4eed1e867c518ec5d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 595.2 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for pmdarima-1.8.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ecb2f6ddbe15b933d0495fc81d15f281eb1d63ff68f2692d6995d2d5fe4aee89
MD5 41d5e773f63267c5afc6016829cb37cc
BLAKE2b-256 3f8213d183284db33481b2b6d5746a5a7c92c30aadfb727f54ee6617c60f1cfb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 595.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for pmdarima-1.8.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9adba8f7e2f34e5d079f2c097c65b733ffcf4a974cf03eba54c37393ec44738e
MD5 12fed131720ef2cde7e8df4847f8a7ed
BLAKE2b-256 ca0c9715bca47429efb8c9f1003d292bbe75c1ecfab85308739b20ea7a9df7f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 544.9 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for pmdarima-1.8.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 b5e4a566845d757301eaae41a35f9dc97c9c61a633d55edc260a0374978da767
MD5 5dd1657aae9185f87c86390b4528610d
BLAKE2b-256 f3c04a891f6170cbb23e07aa48b8a3acdee6bcfaccdbed8bd4e61abe764a1dbd

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-1.8.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 94c1053eee43c62565b3ba4693b2be4e53aad61aa7fd4e86739481d81bdbb1fd
MD5 4dc5323fdb8c94125ebc76080b77555e
BLAKE2b-256 527d64352fc229eba740a9dc0519edb4241ee57106c5d8f73e715dd557a61b47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.3-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 594.5 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for pmdarima-1.8.3-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1193f39d37bc172affddb98011737e6715943882afa178820270910c8b337a93
MD5 cecc7c2d7a9185eef124a5e8af8db89a
BLAKE2b-256 ca4d5f3569b7cf555e64ee794ae80467efb0d22a6852d0c750e068c48a98c5f7

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