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.4.tar.gz (631.5 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.4-cp39-cp39-win_amd64.whl (600.9 kB view details)

Uploaded CPython 3.9Windows x86-64

pmdarima-1.8.4-cp39-cp39-win32.whl (551.2 kB view details)

Uploaded CPython 3.9Windows x86

pmdarima-1.8.4-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.4-cp39-cp39-macosx_10_15_x86_64.whl (603.9 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

pmdarima-1.8.4-cp38-cp38-win_amd64.whl (600.7 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.8.4-cp38-cp38-win32.whl (550.5 kB view details)

Uploaded CPython 3.8Windows x86

pmdarima-1.8.4-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.4-cp38-cp38-macosx_10_15_x86_64.whl (595.7 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.8.4-cp37-cp37m-win_amd64.whl (595.3 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.8.4-cp37-cp37m-win32.whl (545.9 kB view details)

Uploaded CPython 3.7mWindows x86

pmdarima-1.8.4-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.4-cp37-cp37m-macosx_10_15_x86_64.whl (595.8 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.8.4-cp36-cp36m-win_amd64.whl (595.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.8.4-cp36-cp36m-win32.whl (545.5 kB view details)

Uploaded CPython 3.6mWindows x86

pmdarima-1.8.4-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.4-cp36-cp36m-macosx_10_15_x86_64.whl (595.0 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-1.8.4.tar.gz
  • Upload date:
  • Size: 631.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4.tar.gz
Algorithm Hash digest
SHA256 92b17c5baf2f0952f69f0cfae0511ff396bb281387ff315f162cb8f919859b0f
MD5 1ff132624bb2a78342b0d810defc3976
BLAKE2b-256 f24a507395eeec47277e8e3bab35f177948dc6bb74fd974e349d90030dee8a81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 600.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6bf387471a65079b2d5d439438d8c09519b27ef06ae3c0e7f2933495648153f8
MD5 f85e50be3a538f3dd27fae9f03f5240f
BLAKE2b-256 30bdf7e17f4f84ec683dab0d450a7ac8226d6d00c5772987270501a0e047970b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp39-cp39-win32.whl
  • Upload date:
  • Size: 551.2 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 adf5e6fed4a4c9546c32ee3ad5d9341a019cffa54fd4a941eee1f3b9ba693735
MD5 031ffab5ecd413fa749c7363bfa7fcd2
BLAKE2b-256 bac3b0df372adf66aebec303f1b2059e4b783960f7775323b650c3dad60148e3

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.4-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.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 0fb10394973c22f880575da2a47994581af4ccdbe07914d1d5214c605aad7393
MD5 71bac09a5254f4a6fbaedd6ed6bc9147
BLAKE2b-256 c2ec4604b84d383464b3f2190874397e8fc2ab350fe6c9eb39b9e3619aaeac00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 603.9 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e6baf5a15dabda580c7069f84fa8cbc2fab560a28706b531032185e60f957948
MD5 58ec1d568ce0b94e5e9c21b8021f5b66
BLAKE2b-256 e3f451fca1b318cdb01185990bcaada2d7a6a8f9832061a90407fb289223bb14

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 600.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 758cca8c4d29d19c7a2023205dbf747d148a39e054c3c93222b0a33ce899ef74
MD5 21e5e5d3d57340bca5839084cfc78e46
BLAKE2b-256 e156417271d342b5934be1836febbdfdbab44775a13cc6873dfe6a05dac730d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp38-cp38-win32.whl
  • Upload date:
  • Size: 550.5 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 ee077bae483042ff5f9f11ed9a5f42deda4ed78fa60cfd821a824bee88e8f32b
MD5 783bb7bb46054cbc0c5d2c7f4da4541f
BLAKE2b-256 53869f706de49c2bad5c62d7b840af8ee309d78d4c2710ee45ec7d4b390ae350

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.4-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.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 a6273e2fb18f10cb101d9a9971a6f24ad2130002f814e6ea6c86d1c9ebe7d5c0
MD5 dedace9af99021c3f05748465903a744
BLAKE2b-256 fdea584a46c1a25096e76575f89bfa434d2aa237e86071ae24b0e7bf79098932

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 595.7 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6e8a936e63062af0c3e8544b72a06e5d960b2f889b121533326f4214a2517242
MD5 1821117723df3784b0c0884a06b38aec
BLAKE2b-256 0d8db532dc304c61a1a6651684590c17423fe15779a57ee0356d5adebf1c74f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 595.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3886acff6a202e374e7b652842eb36f1b8b57c3b118ed7b926a513f0d2ed2870
MD5 1d6671ddb311b85418e6e4e1c0effbdd
BLAKE2b-256 197cb48f477227e70230cb5130b531bcb6301dbb3f17ef17b0c3c7f48e5faa3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 545.9 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 e4b89cd4ca6b4ae24cbbb6b768260792ed02958d5f698514cc908aa394159490
MD5 96a71014589dec9bd747d34614ceddda
BLAKE2b-256 fd7c2c205a65d8ddc48e7b9c0eb86b6189ae3451fb643e57f5c2a9e1b06e167c

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.4-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.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 2c9e7719f0786bfbff6242f6be4f7ea42cb7f799dda7b319b3dfccd5bd81dc35
MD5 0770c95103a5e46a6fee5f10985e7aec
BLAKE2b-256 ba8192eb684e920e701a1e16d2d596d210b7a98cf68402a24d02813303572751

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 595.8 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d83e4b9bfdaa0e4fdf211c5caab679038627455141a145ae258c4e16a52953b6
MD5 a43991deebab6934dd05c206d73d4551
BLAKE2b-256 a18783fb922ecbdb16c440d7d12e842f56b43c791f5e1af9797bed583a653bb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 595.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c5703bb9e31e9ba48d524ed2029ce74d310836144f4b25bc0451a9dd03836162
MD5 27572a878642b1bbe032f0dccb8deb6b
BLAKE2b-256 a45d3171c00e4b8b8367310fb8411b8b081b873e279ee0e595949eec6b7a2106

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 545.5 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 9c217e98a90c5df6c418172d5ce91a9ed2cc6e844dfdb14de9c53d3d68a8cba3
MD5 dc990d4e1e35c44809531fab31bb6aad
BLAKE2b-256 71d081d5b4877c233c1ee5503b04b563444519ca152d181cb7170c5d38bc29b0

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.4-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.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 6b43b0e5b32ccea545786a5b6da6f34062c37b2aee00d4a3b688906db2477761
MD5 017742fbffedf4585715335f3ac050d4
BLAKE2b-256 b9402fe40b1535d21c77ca2207d1272d4b901d824971fe965380b42da7486b33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.4-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 595.0 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 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.4-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d40a1280826f6b05e572c6af3d495ccad78ed265be8871601b89cbed18b02adf
MD5 14d403320a61b5b0ec7a4d6af5fcd364
BLAKE2b-256 1de953d1b6af713c5d4534778224b5ed3f6307775cc53816fc8b93890c5e448f

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