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

Uploaded CPython 3.8Windows x86-64

pmdarima-1.6.1-cp38-cp38-win32.whl (546.8 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.8

pmdarima-1.6.1-cp38-cp38-macosx_10_15_x86_64.whl (607.8 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.6.1-cp37-cp37m-win_amd64.whl (599.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.6.1-cp37-cp37m-win32.whl (541.1 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7m

pmdarima-1.6.1-cp37-cp37m-macosx_10_15_x86_64.whl (603.1 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.6.1-cp36-cp36m-win_amd64.whl (599.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.6.1-cp36-cp36m-win32.whl (540.8 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

pmdarima-1.6.1-cp36-cp36m-macosx_10_15_x86_64.whl (602.5 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

pmdarima-1.6.1-cp35-cp35m-win_amd64.whl (595.3 kB view details)

Uploaded CPython 3.5mWindows x86-64

pmdarima-1.6.1-cp35-cp35m-win32.whl (538.3 kB view details)

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

pmdarima-1.6.1-cp35-cp35m-macosx_10_15_x86_64.whl (596.4 kB view details)

Uploaded CPython 3.5mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-1.6.1.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.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pmdarima-1.6.1.tar.gz
Algorithm Hash digest
SHA256 d3409defdb2b5a030c1c7047608aca7db7dacf543b09fc8de9a2f3019bd6cc86
MD5 060a71a064b86188890a9aadc47db27f
BLAKE2b-256 283c674df72f3a1da21253c605736afba36ee15be9b2a8746cd955fe291263a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 605.1 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.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pmdarima-1.6.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f3cb048ecf2a89238113153e099aed6383f13da2b2ea2ff5e24e279a89e49287
MD5 3d01835782f34f9e3649292e4f675339
BLAKE2b-256 cb6036113acc5fb938cc2a302bf2cef17eed487785759a2a95aedded95857eb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 546.8 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.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pmdarima-1.6.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 eeb99de6d344d2a2eafedd25f67128e44099d0200130cc5573ba2a1cf6e781d2
MD5 a029237e02907d711bb46fe4ff903ead
BLAKE2b-256 dd564529d5ddf9ae400eae90c3526b0a5ea38424b2d04670194d719c7159c978

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-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.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1db6c8e2176f2ff16c0e46e4ae9121be0e32a7ae05c258427e6b82324fe6c73c
MD5 09f1fafe8eff71b44960a9d87d621b33
BLAKE2b-256 b3df64f92d13517af454c3597a0e031186d8bc05244cead2350e5cc9af966891

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 607.8 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.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pmdarima-1.6.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d23495ec1854824b7dc4dc0c84d5e22428ceb9cd4b71a80e05d3776bde2f5239
MD5 19e56b1840d2e82de92b9130e6312356
BLAKE2b-256 fd81f14ec4e74a5b25edbd4c6ea6e571c1b8a9ec7279a34ee7288303ed4c5e84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 599.0 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.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6d255ff2bf07c602f0a13cf2242af1738e944691f4c22fd3ae8bbcd771b97df9
MD5 5483306650007bd00fbd5a0d2d6c0211
BLAKE2b-256 e5bf44888cf13a4ab8c0c3c5c7cd09347f9c27e8e4dc33696a199eb18dacadd3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 541.1 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.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 99ef3cde65af80e9cabb27efdf0be09ae5d39c9311a74d6b57331886e21aacb6
MD5 50d39b18f7aafca74dd26506ac195747
BLAKE2b-256 73b79b15422821f75cae2c215f183dc61eb23d166569720426d4f6b579ba1098

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-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.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9b9ee9f1cffc1c6420144c20842aba1cd9d67a5ccd4b02c77ea728ee1a0683d2
MD5 7d84f612b72856918f1f0a680d8e3a08
BLAKE2b-256 a2b70f66e4bd550dd964a15ed870015942b91e6c43acf37abcb0c2bd6cece347

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 603.1 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.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 066e7062277834777f28fc7eaca6e07d01b8cabb36f2a08b19087502fa00f3ab
MD5 ed61916b8532f83f59272d6910131b97
BLAKE2b-256 69b8466d86c078b233d0317aad4386484dc7449dc7c239bb3893f245770a7d15

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 599.1 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.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.6.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1baa11c063fa0cd7b541c0a76fc4a16b5549b6bb0f0011e27455da300a6bfb63
MD5 b21c0b6d25c1b03e906f6573f403bfe2
BLAKE2b-256 d4cd9a2d9f9fdb9c70c9c70c179145cdf5c8333a70ce49c9cd7d57c112867bb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 540.8 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.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.6.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 ea21c12eae7106bcfe4f8d56880cdfdb4e26936268104a0273af9b4caaa11702
MD5 eaf89ecb61ce06adc6fd02bfcf77e641
BLAKE2b-256 47d7ee4d81f9be47211e571ff37acb99ed2f19c1de7a55d387f0555be2293d5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-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.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 59a1e3f4b47f2e8bbeed48869a53dc29e0f671920b3529403b850295367db925
MD5 29e47d5621b42c4f4c6dcf7e945d680f
BLAKE2b-256 4b150dfc38deb2f5582b79baff6523b245d6a3dbe877e3fb96a1ee39ec63b626

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 602.5 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.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

File hashes

Hashes for pmdarima-1.6.1-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 de826e7911c1a380f4f5d3a9ae8af2a9261a0137b9c3146ec3974aea893386af
MD5 d76289acd3a491a71d6ed1de651a52dc
BLAKE2b-256 6a48cd4065a25fb57bf26c52308d12646341a176a2ac9f75d126db658854905b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 595.3 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.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.5.4

File hashes

Hashes for pmdarima-1.6.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 52af9b6431a458c66074cd2660b6109513471ecc1c3810b1c4bd3829e9c9232a
MD5 2dce0464831c6cc97756c844dbdfb436
BLAKE2b-256 eb8fdf92ecd2647faa160bb559789ff1bf3c8208a17c619af2da56adc51982f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 538.3 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.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.5.4

File hashes

Hashes for pmdarima-1.6.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 56aeade10ab1fcf55affc27ec779a65144eac8676a0752884d94b3073fcd29da
MD5 28e55cbfd875526d0c5a78f2d459915f
BLAKE2b-256 9f95e0c137b27ac0acd483c580ea5bf82925b479e65f583f6e721218adc282ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-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.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pmdarima-1.6.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c442f049022d8c3f1a57c7b4894fdf3abed50cb969d546b375e69c71d20580db
MD5 847860e43ba5530b3c9a6108decee4fb
BLAKE2b-256 fedd090585ec988d9e07c2a534aa6d5325a5fd8af68206276b0edbf5aa91af65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.6.1-cp35-cp35m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 596.4 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.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.5.9

File hashes

Hashes for pmdarima-1.6.1-cp35-cp35m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f563457c16c7260c7def7bae5a04e651be65d1e1b95f3a42675ae51f7d9ed8d6
MD5 f239907bfd78c5f09dbf9d8ce9943350
BLAKE2b-256 c27926f4a36e04fa7ee2c253069163cef0175101b00d93e9ecccb8931c9c268a

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