{"id":13415346,"url":"https://github.com/alkaline-ml/pmdarima","last_synced_at":"2025-05-14T02:08:13.716Z","repository":{"id":19295215,"uuid":"86715491","full_name":"alkaline-ml/pmdarima","owner":"alkaline-ml","description":"A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.","archived":false,"fork":false,"pushed_at":"2024-11-13T21:41:20.000Z","size":81176,"stargazers_count":1641,"open_issues_count":66,"forks_count":239,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-05-06T01:01:56.146Z","etag":null,"topics":["arima","econometrics","forecasting","forecasting-models","machine-learning","pmdarima","python","sarimax","time-series"],"latest_commit_sha":null,"homepage":"https://www.alkaline-ml.com/pmdarima","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alkaline-ml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["tgsmith61591","aaronreidsmith"]}},"created_at":"2017-03-30T14:58:30.000Z","updated_at":"2025-04-30T18:11:08.000Z","dependencies_parsed_at":"2023-01-13T20:17:23.546Z","dependency_job_id":"5ff306cd-69e6-4ae6-a75e-4af7d812f22e","html_url":"https://github.com/alkaline-ml/pmdarima","commit_stats":{"total_commits":860,"total_committers":23,"mean_commits":"37.391304347826086","dds":0.2709302325581395,"last_synced_commit":"11e570897178d844637c387d6582ab2136a92af5"},"previous_names":["tgsmith61591/pyramid","tgsmith61591/pmdarima"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkaline-ml%2Fpmdarima","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkaline-ml%2Fpmdarima/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkaline-ml%2Fpmdarima/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkaline-ml%2Fpmdarima/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alkaline-ml","download_url":"https://codeload.github.com/alkaline-ml/pmdarima/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253726735,"owners_count":21954094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arima","econometrics","forecasting","forecasting-models","machine-learning","pmdarima","python","sarimax","time-series"],"created_at":"2024-07-30T21:00:47.406Z","updated_at":"2025-05-14T02:08:08.704Z","avatar_url":"https://github.com/alkaline-ml.png","language":"Python","funding_links":["https://github.com/sponsors/tgsmith61591","https://github.com/sponsors/aaronreidsmith"],"categories":["Python：量化金融第一生态","相关包","TimeSeries Analysis","Python","Code-Resource","Analytic tools","Others","\u003cspan id=\"head7\"\u003e2.2. (Deep Learning based) Time Series Analysis\u003c/span\u003e","Time Series","Time-Series \u0026 Financial","📦 Packages","时间序列","⏳ Time Series Analysis"],"sub_categories":["六、时间序列分析与预测","预测","Cryptocurrencies","2020","TimeSeries Analysis","Others","Time Series","Python","Tools"],"readme":"# pmdarima\n\n[![PyPI version](https://badge.fury.io/py/pmdarima.svg)](https://badge.fury.io/py/pmdarima)\n[![CircleCI](https://circleci.com/gh/alkaline-ml/pmdarima.svg?style=svg)](https://circleci.com/gh/alkaline-ml/pmdarima)\n[![Github Actions Status](https://github.com/alkaline-ml/pmdarima/workflows/Mac%20and%20Windows%20Builds/badge.svg?branch=master)](https://github.com/alkaline-ml/pmdarima/actions?query=workflow%3A%22Mac+and+Windows+Builds%22+branch%3Amaster)\n[![codecov](https://codecov.io/gh/alkaline-ml/pmdarima/branch/master/graph/badge.svg)](https://codecov.io/gh/alkaline-ml/pmdarima)\n![Supported versions](https://img.shields.io/badge/python-3.9+-blue.svg)\n![Downloads](https://img.shields.io/badge/dynamic/json?color=blue\u0026label=downloads\u0026query=%24.total\u0026url=https%3A%2F%2Fstore.zapier.com%2Fapi%2Frecords%3Fsecret%3D1e061b29db6c4f15af01103d403b0237)\n![Downloads/Week](https://img.shields.io/badge/dynamic/json?color=blue\u0026label=downloads%2Fweek\u0026query=%24.weekly\u0026url=https%3A%2F%2Fstore.zapier.com%2Fapi%2Frecords%3Fsecret%3D1e061b29db6c4f15af01103d403b0237)\n\nPmdarima (originally `pyramid-arima`, for the anagram of 'py' + 'arima') is a statistical\nlibrary designed to fill the void in Python's time series analysis capabilities. This includes:\n\n  * The equivalent of R's [`auto.arima`](https://www.rdocumentation.org/packages/forecast/versions/7.3/topics/auto.arima) functionality\n  * A collection of statistical tests of stationarity and seasonality\n  * Time series utilities, such as differencing and inverse differencing\n  * Numerous endogenous and exogenous transformers and featurizers, including Box-Cox and Fourier transformations\n  * Seasonal time series decompositions\n  * Cross-validation utilities\n  * A rich collection of built-in time series datasets for prototyping and examples\n  * Scikit-learn-esque pipelines to consolidate your estimators and promote productionization\n  \nPmdarima wraps [statsmodels](https://github.com/statsmodels/statsmodels/blob/master/statsmodels)\nunder the hood, but is designed with an interface that's familiar to users coming\nfrom a scikit-learn background.\n\n## Installation\n\n### pip\n\nPmdarima has binary and source distributions for Windows, Mac and Linux (`manylinux`) on pypi\nunder the package name `pmdarima` and can be downloaded via `pip`:\n\n```bash\npip install pmdarima\n```\n\n### conda\n\nPmdarima also has Mac and Linux builds available via `conda` and can be installed like so:\n\n```bash\nconda config --add channels conda-forge\nconda config --set channel_priority strict\nconda install pmdarima\n```\n\n**Note:** We do not maintain our own Conda binaries, they are maintained at https://github.com/conda-forge/pmdarima-feedstock.\nSee that repo for further documentation on working with Pmdarima on Conda.\n\n## Quickstart Examples\n\nFitting a simple auto-ARIMA on the [`wineind`](https://alkaline-ml.com/pmdarima/modules/generated/pmdarima.datasets.load_wineind.html#pmdarima.datasets.load_wineind) dataset:\n\n```python\nimport pmdarima as pm\nfrom pmdarima.model_selection import train_test_split\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Load/split your data\ny = pm.datasets.load_wineind()\ntrain, test = train_test_split(y, train_size=150)\n\n# Fit your model\nmodel = pm.auto_arima(train, seasonal=True, m=12)\n\n# make your forecasts\nforecasts = model.predict(test.shape[0])  # predict N steps into the future\n\n# Visualize the forecasts (blue=train, green=forecasts)\nx = np.arange(y.shape[0])\nplt.plot(x[:150], train, c='blue')\nplt.plot(x[150:], forecasts, c='green')\nplt.show()\n```\n\n\u003cimg src=\"http://alkaline-ml.com/img/static/pmdarima_readme_example1.png\" alt=\"Wineind example\"/\u003e\n\n\nFitting a more complex pipeline on the [`sunspots`](https://www.rdocumentation.org/packages/datasets/versions/3.6.1/topics/sunspots) dataset,\nserializing it, and then loading it from disk to make predictions:\n\n```python\nimport pmdarima as pm\nfrom pmdarima.model_selection import train_test_split\nfrom pmdarima.pipeline import Pipeline\nfrom pmdarima.preprocessing import BoxCoxEndogTransformer\nimport pickle\n\n# Load/split your data\ny = pm.datasets.load_sunspots()\ntrain, test = train_test_split(y, train_size=2700)\n\n# Define and fit your pipeline\npipeline = Pipeline([\n    ('boxcox', BoxCoxEndogTransformer(lmbda2=1e-6)),  # lmbda2 avoids negative values\n    ('arima', pm.AutoARIMA(seasonal=True, m=12,\n                           suppress_warnings=True,\n                           trace=True))\n])\n\npipeline.fit(train)\n\n# Serialize your model just like you would in scikit:\nwith open('model.pkl', 'wb') as pkl:\n    pickle.dump(pipeline, pkl)\n    \n# Load it and make predictions seamlessly:\nwith open('model.pkl', 'rb') as pkl:\n    mod = pickle.load(pkl)\n    print(mod.predict(15))\n# [25.20580375 25.05573898 24.4263037  23.56766793 22.67463049 21.82231043\n# 21.04061069 20.33693017 19.70906027 19.1509862  18.6555793  18.21577243\n# 17.8250318  17.47750614 17.16803394]\n```\n\n\n### Availability\n\n`pmdarima` is available on PyPi in pre-built Wheel files for Python 3.9+ for the following platforms:\n\n* Mac (64-bit)\n* Linux (64-bit manylinux)\n* Windows (64-bit)\n  * 32-bit wheels are available for pmdarima versions below 2.0.0 and Python versions below 3.10\n\nIf a wheel doesn't exist for your platform, you can still `pip install` and it\nwill build from the source distribution tarball, however you'll need `cython\u003e=0.29`\nand `gcc` (Mac/Linux) or `MinGW` (Windows) in order to build the package from source.\n\nNote that legacy versions (\u003c1.0.0) are available under the name\n\"`pyramid-arima`\" and can be pip installed via:\n\n```bash\n# Legacy warning:\n$ pip install pyramid-arima\n# python -c 'import pyramid;'\n```\n\nHowever, this is not recommended.\n\n## Documentation\n\nAll of your questions and more (including examples and guides) can be answered by\nthe [`pmdarima` documentation](https://www.alkaline-ml.com/pmdarima). If not, always\nfeel free to file an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falkaline-ml%2Fpmdarima","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falkaline-ml%2Fpmdarima","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falkaline-ml%2Fpmdarima/lists"}