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

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

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)

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.7.0.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.7.0-cp38-cp38-win_amd64.whl (614.0 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.7.0-cp38-cp38-win32.whl (555.4 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.8

pmdarima-1.7.0-cp38-cp38-macosx_10_15_x86_64.whl (615.9 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.7.0-cp37-cp37m-win_amd64.whl (608.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.7.0-cp37-cp37m-win32.whl (549.6 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7m

pmdarima-1.7.0-cp37-cp37m-macosx_10_15_x86_64.whl (611.2 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.7.0-cp36-cp36m-win_amd64.whl (608.0 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.7.0-cp36-cp36m-win32.whl (549.5 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

pmdarima-1.7.0-cp36-cp36m-macosx_10_15_x86_64.whl (610.6 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

pmdarima-1.7.0-cp35-cp35m-win_amd64.whl (604.2 kB view details)

Uploaded CPython 3.5mWindows x86-64

pmdarima-1.7.0-cp35-cp35m-win32.whl (547.1 kB view details)

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

pmdarima-1.7.0-cp35-cp35m-macosx_10_15_x86_64.whl (605.1 kB view details)

Uploaded CPython 3.5mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-1.7.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.9

File hashes

Hashes for pmdarima-1.7.0.tar.gz
Algorithm Hash digest
SHA256 4ece5df334d4ca73eedc046ded35dbb2d2962886e408719e88197773a0d95956
MD5 cc5d39500f3dead43d4d001dc1229ffd
BLAKE2b-256 5cd4e6e82eae105b947a8b3070f99661607c54ede9e1e73b8d183ad85c550f33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 614.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pmdarima-1.7.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 677cc8ff98e12c73f1993798f1ccbc2141dbe6a070d850f473271da0774aacdd
MD5 715a00dbc29831400ba39044055c7634
BLAKE2b-256 f77784fd5b3b8731d33c2470a2f14f6cc7d704abdcb423163bcec0120e4b9709

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 555.4 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pmdarima-1.7.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 53e457289f7bbd8ec93194e307a97e13812b7e9728e0512f19c235cceeaa3e9d
MD5 7f17f975471e2befb4ae29407b030259
BLAKE2b-256 8e5678b17a83cffb4b9c0d022161fe2f7d60bfa5d4251b22fe4a3eeb053dd2f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for pmdarima-1.7.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9c30381f02d1ae3436f3498ff8595ef5735f8dc6290d507e437fad6ee8edb175
MD5 a1336ccbab60a91fcc090d4de2a147c0
BLAKE2b-256 3c3befc7d7d1a046f2505aa8c13d06534be97efe45f93389b1faa1d8b9bd4a2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 615.9 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pmdarima-1.7.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 38322823fc6a86c3c22d46f295600a7c290f92fa089732ba7d302deca9fdf4ee
MD5 a04f8892dc5a14f5b103e1532c8c4db9
BLAKE2b-256 585636af589ca1674f9c9f16bdc5ac6891f761cddf1cd6743da6eaede205c360

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 608.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for pmdarima-1.7.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c418f0db273576bb1bdcb90bf19ca10ed6b6878b42d696ea9920a29d3fae3c42
MD5 94ff5411c7a5122616bf321a9f50137d
BLAKE2b-256 c563c1ea93871f1a4aecabe85c7d3c9b4134ca953592771cc76155e7776c139b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 549.6 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for pmdarima-1.7.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 f7ff640afbf9c521a1391a6861d8b21278da709ee74e70fdcb2250c6669a63c5
MD5 8a4477a062fbc1499158ddfea95179f1
BLAKE2b-256 f708bae32153201f76b0ef99464faeb7236cfdbfcc2140de76fcd1a9554e15fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for pmdarima-1.7.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 250ec734c9be742372e8b0f692b0e18783220a281d718beb79b9d5ea2529a755
MD5 0a19febaaaf626403500cc13ae82aff4
BLAKE2b-256 d8b1822f20c9f0943f25393348e5313fa222b475640139f8b55cf49af4735d9a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 611.2 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for pmdarima-1.7.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 04a2a0c3f217d4a0a55ada9e25165fff0d3957a9646c8c78f463ed9a2f39c2d3
MD5 40b58ef2e705b9373e7dff85626d0eec
BLAKE2b-256 34d9d29b0f64e861b05f192f3ef510cbf963394af23839a194fb11dfaca01c7b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pmdarima-1.7.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 481a692f5ec2830481ec63497ebb284c70793888a298c4bb177cda5c86a68eb6
MD5 3eaf8aeee8ddefc39572dd8031d96843
BLAKE2b-256 fe370b7e2504d3d2a63eb1cbc98cb161c8b3f38202bdbe0d41a987dac5279abd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pmdarima-1.7.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 a419050a837aded98f7784722ca3ee9f97f5d901838a058678ad753918e87af5
MD5 25e7615318651e540246eb026dfcf5c5
BLAKE2b-256 56efd75dfdf4c251a3c761447caa53654d0bf81fb2521b1bc6cdbb73d3a8595d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for pmdarima-1.7.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 83c1bcc11350fa9f73b9f2ec964b1e018ee7fd6d2532bff19d8d19be0d7e6e0c
MD5 6627ac3c4627394997e7c5109e066274
BLAKE2b-256 6de96587edeffba78fbed826c45d2e85edfba1fcb18f3d7d5347b20cdbdc7327

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 610.6 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11

File hashes

Hashes for pmdarima-1.7.0-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3befea59c7209bd99cb4bac61e7bc0d2956ba087349e6af9907a0926f058b743
MD5 6d578bba061eb87fc555d29fa7dda810
BLAKE2b-256 474526ea5c1b836c70a66de96c461cb93205cbb89198b812ad455990869a827d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 604.2 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.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.4

File hashes

Hashes for pmdarima-1.7.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e4919ba56366a97b7f2bd62cc94187db56755d9d4feacf1b087f14439b0d40b0
MD5 dc1596b96d083c24af7382e6d724083f
BLAKE2b-256 4bd2636381698a1fef397f1b8dd9841aa72add177606d5be75f315a652e6d742

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 547.1 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.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.4

File hashes

Hashes for pmdarima-1.7.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 9fb15feb4e6529ddf78327275b258a0ddb41a2c268997dba129cc2910c9c8015
MD5 b1283a659dbcadf8005a952fd6b8bf99
BLAKE2b-256 9a150d7ed2f49dd83075b9e07cf6e329c263cb58021fa72f83665ed9f785e276

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for pmdarima-1.7.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 08341ab1bea130ef41b83148e7b96c54cb9166511976cde0544af3718d6b6be0
MD5 b1907e7f2706add275d849c6da739c32
BLAKE2b-256 1187384f5ad7759bb0a48a04d4d1d009a0323178bb0c4aa57b9ab7cbd722ebe3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.7.0-cp35-cp35m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 605.1 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.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.9

File hashes

Hashes for pmdarima-1.7.0-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fa0c22a5f405e524bdc29ac4484ddbc737984f292ae0a11b7c86ea0f53a214ec
MD5 e86d4809d11a2e0470a8ba63e1a038b6
BLAKE2b-256 43fd30b47406b24d34cab7864df91c4557a7f794696bf643f686e07682fdcc87

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