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

  • Mac (64-bit)
  • Linux (64-bit manylinux)
  • Windows (64-bit)
    • 32-bit wheels are available for pmdarima versions below 2.0.0 and Python versions below 3.10

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-2.0.1.tar.gz (639.0 kB view details)

Uploaded Source

Built Distributions

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

pmdarima-2.0.1-cp310-cp310-win_amd64.whl (568.9 kB view details)

Uploaded CPython 3.10Windows x86-64

pmdarima-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pmdarima-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

pmdarima-2.0.1-cp310-cp310-macosx_11_0_arm64.whl (576.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pmdarima-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl (607.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pmdarima-2.0.1-cp39-cp39-win_amd64.whl (572.0 kB view details)

Uploaded CPython 3.9Windows x86-64

pmdarima-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (1.9 MB view details)

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

pmdarima-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

pmdarima-2.0.1-cp39-cp39-macosx_11_0_arm64.whl (577.3 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pmdarima-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl (608.2 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pmdarima-2.0.1-cp38-cp38-win_amd64.whl (571.9 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-2.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (1.9 MB view details)

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

pmdarima-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

pmdarima-2.0.1-cp38-cp38-macosx_11_0_arm64.whl (571.8 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pmdarima-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl (601.1 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pmdarima-2.0.1-cp37-cp37m-win_amd64.whl (568.5 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-2.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (1.8 MB view details)

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

pmdarima-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

pmdarima-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl (601.2 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-2.0.1.tar.gz
  • Upload date:
  • Size: 639.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pmdarima-2.0.1.tar.gz
Algorithm Hash digest
SHA256 9220dc7338e3a617d0f3aaf29cbcf9ac646b3c8a5ae585f9a366f9723b8dfc78
MD5 85453e80a2e357ff3a3949390df44e95
BLAKE2b-256 cfd30fe77fe4f269a2dad3cb6f5fe1b942e70c0c3f87f3ca3ec36914320f981c

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pmdarima-2.0.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 568.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pmdarima-2.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b3d4806f277644e72fd31981bdd71580ee9cf29aab2db7b3a754dbac7759bb15
MD5 c6f1f0ab51eb51718e8d764f32c4d2c9
BLAKE2b-256 8f0bdf0b77811c0e9ce9dd9e4d50b349ae72998d10c15ccbd4fdb9bda12e0c9a

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1adc8900953172d9fb95a94fcf778c6779f5bf9241859a003ac88ca9801a121d
MD5 e9f281e5fd2c0fcf86f8d670b6f12458
BLAKE2b-256 761a1500f39c08110211c84c83517a48d63e9f20506fd3ffe306538bf767ad5d

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 120bb1c16719a039fdbc50ef00bc979760e7087835a5f9f15b8f11885560a72c
MD5 3195050266e7867fe9335c35e18eecb5
BLAKE2b-256 f033d3039e149309602056a91e757c5a77889dcf25374f741131f6945b4a73b1

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa3d84edde7783c16206f3d2b605d32f56a89001f7c3e6752f9a26f14dbf13e5
MD5 cc9e74ad073bdc55ab472a1ae1ad6969
BLAKE2b-256 57f5fc54cbb5f54b421a6a0537a2f9405cdfa8daaac5df0eeed69522fa6fc4bd

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3c8ad41798448fe0d74896d7c42d2bc93d715efae4b61b9346e1739384438ca8
MD5 58c75331880a40b1996b2227002a6817
BLAKE2b-256 8bdef306566eb2025bd964069cdb3033c59e427161e4720f337d928c503b0b0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-2.0.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 572.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pmdarima-2.0.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9596875c436f2485c2fc9310e6d4d99e3c6486c675325415020479a54a88db9f
MD5 af7d5163061a00459fa0980887a132bc
BLAKE2b-256 210b041fc844c3153289a7d82cf8cc7f5d465089e7183bf9c80f1dc9a9d3d388

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fae463b03b850fdfca419a67c63fd6196ba99be383c23d6593f6ad67196407c5
MD5 629eab22e995be21893c2f8fbdc4e5a6
BLAKE2b-256 37e8f461bdd19d4ebfdeaddbb899e4d40b5688117f6eec59edd99175c4ce3aa6

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d2f9ce6d72d9d7e9d81f8e50f97e944babff28226473fb03a6c89464a64467e5
MD5 4bdea45b377d6491620014b6f2f42eca
BLAKE2b-256 41917ecc86ca2a7eee405d4c2f831b11b546fdbc0d2f55ca191c60aa2eda5017

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5525006b8bd60666dc4bdadc404b93184b75bbf26e61f18498684ff7b319961f
MD5 5f438b8b96763a641d0812a20f7d2404
BLAKE2b-256 27edd1a8d030d944b1d76a9d4b40d4adebf86529904abee2023a0eb4358d6478

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4395839cf4bb6e20f3fbce75b60adb20b0d4a8e9a53bf86a45a671f71dd83d24
MD5 1cdbaee65221c4b8cba0b0b32f89f202
BLAKE2b-256 ff081db5913f1b55c0c515c69081c003f2054b98d8a1eef3f340f4d505f340e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-2.0.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 571.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pmdarima-2.0.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6ff57e0680b4585c9523684d824b0580c68a8dbef8e2b6a6f1da2f811eee443d
MD5 56d2081bac2f15fe78c4c6cf88553d0a
BLAKE2b-256 207cdb4d369789e304c875fd00420cb81ecf227ff1a2fb52f36080fd0739ba28

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 86f99c953fa271c1bc496e36e6dabdbe39c9762c63faad766f3fd3397f29720b
MD5 80d24baf24ba89d583b8e5320675bbea
BLAKE2b-256 de96c6b470a720354fe2546a76a94e899bad27212aa51597d536413bb63a7ea3

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 14706be2023a1e03f971c03886bc88bd934b0c862bf7814757b23b4017c28efa
MD5 c154c525ffd6f3696a0a3c7a74ddc9e6
BLAKE2b-256 a4f434bf97e06240c18a7c43a88599826f8de6e01cb07d33c1013ec4ed2898e4

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7c3ba4aacd3bc3c5c960d4d1543316a2298e0a7e5037389a65c9f8c7e59e03c
MD5 2b13493f2ed8db4eedae5bd138c04fe2
BLAKE2b-256 e69ee1ea44808cddaa85d7ca81f156217925ef56e6c9d2afae5fea99004ea063

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eb2d5d179bbc275855e1ef586300bc697065ac743318920e4b5f574d572604d0
MD5 5fb5865b6c7b72fdfe5ca76a95ab5ac2
BLAKE2b-256 806013d7959a590ae722ab2a3f4d4b03f248d7ac1f16ea0e2213810ccbd5da82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-2.0.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 568.5 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.9

File hashes

Hashes for pmdarima-2.0.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f336f80eb4bd009c23e2abdb83d603d45a7e3c6a3b6206608e487efc5ddf74f2
MD5 092fedccb916d7a7f5c36893a51f07d3
BLAKE2b-256 790dffb2ed5e07a164bfa076362d81821a6e2b9703a05411d2eb41f4a956f425

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c0fb3abec29523b10c567d14ec3f858e46d1759edc5c1db53d72de9aeb5ac808
MD5 12a5e8fdecbbef502495c944600d9f78
BLAKE2b-256 d9085fa4142a6a4ddd4cafdfa8a12f70c9404264d03552e2211cdffbaff2f2cb

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a816b288a282b9130ae59e1ec73fff073a34c21b64b78e889049535b2448fe7c
MD5 656c86db75c61fbc272516ae2c53182d
BLAKE2b-256 4314e2cf9a6dfb7a1449bd4a53e79612d25b1d76fa35250489ce752ba3ba3380

See more details on using hashes here.

File details

Details for the file pmdarima-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pmdarima-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f599ce30f03d71c400add1f7535724c15fde3a46d8ac512c13cff3500dc5a524
MD5 c37df28593f1653ddf99c62a176b01bd
BLAKE2b-256 49d60f8ddc059ca210b1f4a5a770416c56dcbdf0f6b7078fa2a1169d0c8df3ec

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