Skip to content

Commit

Permalink
[MRG+1] Add fittedvalues to public ARIMA api (#495)
Browse files Browse the repository at this point in the history
* Address #493

* Add a unit test

* Fix build requirements

* 📚 Add to doc. Again...
  • Loading branch information
tgsmith61591 authored Apr 16, 2022
1 parent c6ace44 commit 0c7a3a2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
3 changes: 1 addition & 2 deletions build_tools/build_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
numpy~=1.19.3; python_version < '3.10'
numpy~=1.21.2; python_version >= '3.10'
numpy~=1.21.2
scipy>=1.3.2
cython>=0.29,!=0.29.18
scikit-learn>=0.22
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Other versions

Documentation for other release versions of ``pmdarima``:

* `v2.0.0 <http://alkaline-ml.com/pmdarima/2.0.0>`_
* `v1.8.5 <http://alkaline-ml.com/pmdarima/1.8.5>`_
* `v1.8.4 <http://alkaline-ml.com/pmdarima/1.8.4>`_
* `v1.8.3 <http://alkaline-ml.com/pmdarima/1.8.3>`_
Expand Down
10 changes: 9 additions & 1 deletion doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ What's new in pmdarima
As new releases of pmdarima are pushed out, the following list (introduced in
v0.8.1) will document the latest features.

`v1.8.6 <http://alkaline-ml.com/pmdarima/1.8.6>`_
`v2.0.0 <http://alkaline-ml.com/pmdarima/2.0.0>`_
-------------------------------------------------

* Remove deprecation warnings for the ``exogenous`` keyword introduced in 1.8.0

* Remove deprecation warnings for the ``sarimax_kwargs`` keyword introduced in 1.5.1

* Bump numpy dependency to >= 1.21

* Expose ``fittedvalues`` in the public API. See `#493 <https://github.com/alkaline-ml/pmdarima/issues/493>`_

* Add support for ARM64 architecture. See `#434 <https://github.com/alkaline-ml/pmdarima/issues/434>`_

`v1.8.5 <http://alkaline-ml.com/pmdarima/1.8.5>`_
Expand Down
11 changes: 11 additions & 0 deletions pmdarima/arima/arima.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,17 @@ def df_resid(self):
"""
return self.arima_res_.df_resid

@if_delegate_has_method('arima_res_')
def fittedvalues(self):
"""Get the fitted values from the model
Returns
-------
fittedvalues : array-like
The predicted values for the original series
"""
return self.arima_res_.fittedvalues

@if_delegate_has_method('arima_res_')
def hqic(self):
"""Get the Hannan-Quinn Information Criterion:
Expand Down
2 changes: 1 addition & 1 deletion pmdarima/arima/tests/test_arima.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def _try_get_attrs(arima):
attrs = {
'aic', 'aicc', 'arparams', 'arroots', 'bic', 'bse', 'conf_int',
'df_model', 'df_resid', 'hqic', 'maparams', 'maroots',
'params', 'pvalues', 'resid',
'params', 'pvalues', 'resid', 'fittedvalues',
}

# this just shows all of these attrs work.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
joblib>=0.11
Cython>=0.29,!=0.29.18
numpy>=1.19.3
numpy>=1.21
pandas>=0.19
scikit-learn>=0.22
scipy>=1.3.2
Expand Down

0 comments on commit 0c7a3a2

Please sign in to comment.