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.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.2.tar.gz (1.0 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.8.2-cp39-cp39-win_amd64.whl (596.7 kB view details)

Uploaded CPython 3.9Windows x86-64

pmdarima-1.8.2-cp39-cp39-win32.whl (547.3 kB view details)

Uploaded CPython 3.9Windows x86

pmdarima-1.8.2-cp39-cp39-manylinux1_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9

pmdarima-1.8.2-cp39-cp39-macosx_10_15_x86_64.whl (600.4 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

pmdarima-1.8.2-cp38-cp38-win_amd64.whl (596.7 kB view details)

Uploaded CPython 3.8Windows x86-64

pmdarima-1.8.2-cp38-cp38-win32.whl (547.0 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.8

pmdarima-1.8.2-cp38-cp38-macosx_10_15_x86_64.whl (592.4 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

pmdarima-1.8.2-cp37-cp37m-win_amd64.whl (591.6 kB view details)

Uploaded CPython 3.7mWindows x86-64

pmdarima-1.8.2-cp37-cp37m-win32.whl (542.1 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7m

pmdarima-1.8.2-cp37-cp37m-macosx_10_15_x86_64.whl (592.4 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

pmdarima-1.8.2-cp36-cp36m-win_amd64.whl (591.5 kB view details)

Uploaded CPython 3.6mWindows x86-64

pmdarima-1.8.2-cp36-cp36m-win32.whl (541.7 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

pmdarima-1.8.2-cp36-cp36m-macosx_10_15_x86_64.whl (591.7 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pmdarima-1.8.2.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for pmdarima-1.8.2.tar.gz
Algorithm Hash digest
SHA256 4aad8cb9d4f3d2bbf78a807d383e23f445dbf4691741b69c90655d932417a521
MD5 2a0c0e4c53018ea2d7f3b9b5aa9f72cd
BLAKE2b-256 57dea4e2ff8fbebd783e4c9024ed73918f5d8ce0b38da6ef758e2c4d770f0358

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 596.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pmdarima-1.8.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 84795655ecd06fa3b09cfbc6d88f5da543df86dac4672c56209158c4cfccdd2e
MD5 19f9d1353f5550f21e8606dc90443e94
BLAKE2b-256 4e745ecb767bea202946d57bd590c21ef756a5f89ec18ee9b7266ded48f1e430

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp39-cp39-win32.whl
  • Upload date:
  • Size: 547.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pmdarima-1.8.2-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 9763d0d07061ce26f68559d2c3ff34c8aa7a4d1577991c5072a96cd5053f380c
MD5 791ab4cdf7348158a96b4cd3c12bdb34
BLAKE2b-256 ea8421540dda1ecf60dee8362e3071d448765441594dd72fc141b8eddd72c6c7

See more details on using hashes here.

File details

Details for the file pmdarima-1.8.2-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: pmdarima-1.8.2-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.2-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9e5e3bf07455b066422541cede7f642d6ecf3d79a472e83445899d33599924d4
MD5 7bea7d18ebbef67bc55175f439a56c71
BLAKE2b-256 9819a06e2b73683d996f342efb5b1495708026b727ddb538e7d9177d37cab4dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 600.4 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pmdarima-1.8.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9f077e7beabeff7d6e49c1079f9dc884cdaee0151b6c1350494d3bf8c44d1f83
MD5 c778ccb504f8005ab500422e1f4f288b
BLAKE2b-256 5c4a8901ca11001d16ae3d07a8c6a4c5e10d82a5c95e203a43161b16bab97f95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 596.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for pmdarima-1.8.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ef63e1b5213593aa53027b35afab3bf52ffab10ee5648fc149bc0195889fe233
MD5 122c7f30b20a75c13375c514300f5b2c
BLAKE2b-256 a8078eb7fa6598c03b1bb29b930f80e0e5866a08af2043a4a580972ee7555d04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp38-cp38-win32.whl
  • Upload date:
  • Size: 547.0 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for pmdarima-1.8.2-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 3babff35633ab48b008bf578618d526aebae8f06607dc2b8d1fc4d81d39e5c8d
MD5 025cefe025e54d7994e06f498f1475a2
BLAKE2b-256 ce911fb9d4e8299835d4ee5d3ac6c24e111c23878eef271f99b10f77c345a9c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-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.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3ba0b957feee5b96e1fe952194fd9c20ffead058ba242b4dc1af68a6d6ea3609
MD5 24c4b01746ceeda20bf84ea02f00168f
BLAKE2b-256 1d20d3c04cea8328a7cde900601fc21f5953d1720680a005d10142f840970c88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 592.4 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for pmdarima-1.8.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1ec4db6314acdc9480456cc898e63f7da198b356531fee07b06d10a878bc5d38
MD5 8937d82b145a869d068aaeb57de772b3
BLAKE2b-256 d52e05dc6b1453939f52092b215e1534a0ed1d523e1335b465eb44cd20291b71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 591.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for pmdarima-1.8.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e514d0a8a7ee627324ec2a887e2cb55f53fcbca140fe18b52504f35a8e23efba
MD5 d2e24278076394aa091ec65980506f33
BLAKE2b-256 297d869a72d01c073bda028b851991a6ea08277e2eee9af6ab6423f9852e40fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 542.1 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for pmdarima-1.8.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 686f88db56b9ebb822869d1b85dd79acb11c0ad39a9cb7de0f1fee7a3c085cd3
MD5 c763eb266e75fea38ded25d92059c2e8
BLAKE2b-256 1c27339c905b789d178adf5ad7743774559337b3d3716f85c44f33978839d212

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-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.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 207ff38615a1251297e7ee15fd9a76cee9706a9837697c61b6c48a2309cbaec1
MD5 45d1d1bda012924c90804a95be2200be
BLAKE2b-256 f4c22a94bce6bba1deac3c0b16dbb14f28de0b9035e3211919cae8448455aa65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 592.4 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c00673fe4aef38b4d29b0467e31e321fa4bd927ce7ce61c04cdccb7d413c3ec5
MD5 e1167dc53528ef8df3320e76fb714856
BLAKE2b-256 7d378938cf615d83b66cbd217f7aeb583caff507c1de9243d38ebee9e9f44922

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 591.5 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.8.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 76b4c09ac70f5c05804056d28242ecbd7f6f791a0a166c6f204adc52a7a915b9
MD5 b4edad6cd13cbe394d61960c66a81f54
BLAKE2b-256 d94034b1a5718afc3c1028c67783187384bc85d071c0bc4596f88b45e71ebdbe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 541.7 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for pmdarima-1.8.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 9869a15ff7c4f8c263bc490ff948abd209097fee1dd6c4f4dd8ef88f7c5e9022
MD5 4748e047035e08bb976420f8c4ab7b1d
BLAKE2b-256 6db5e748fa368f5067345ed28ba3e389d5934626c6ee9aea58ff300669f6ca94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-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.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

File hashes

Hashes for pmdarima-1.8.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bad2cb1ba28487f927ea2b4796f5b957b829602809c0ad215445dc24e4b8611a
MD5 b261d8c31732873bcba98571c460f27f
BLAKE2b-256 b867b73b3cc825a0a4988da3c4dad0445979c394a4c2cf63d3665c8127361e01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmdarima-1.8.2-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 591.7 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for pmdarima-1.8.2-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 837916788ea65d46afc1c081196c1632d587a85299572ef7a8a0d5bf0e2b5399
MD5 0efc186c60e027111e3e72c5e3b35e37
BLAKE2b-256 841f1fead26eafb7110aa30a1b1020f4916e225e156b58c85f228271d9fb279d

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