-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: predict() got an unexpected keyword argument 'typ' raised during cross-validation #29
Comments
Thanks for filing! And good sleuthing. I'll take a look into this and the fix will be part of 0.7.0 |
This was technically handled in #28 since the new code doesn't use if cv_samples is not None:
# get the predictions (use self.predict, which calls forecast
# from statsmodels internally)
pred = self.predict(n_periods=cv, exogenous=cv_exog)
self.oob_ = scoring(cv_samples, pred, **self.scoring_args)
# If we compute out of sample scores, we have to now update the
# observed time points so future forecasts originate from the end
# of our y vec
self.add_new_observations(cv_samples, cv_exog)
else:
self.oob_ = np.nan But to be sure, I've included some new unit tests for cases where from pyramid.arima import ARIMA
import numpy as np
# Test Issue #29 (d=0, cv=True) -----------------------------------------------
def test_oob_for_issue_29():
y = np.array([3.0, 4.0, 1.0, 2.0, 1.0, 2.0, 0.0, 1.0,
0.0, 0.0, 2.0, 0.0, 1.0, 1.0, 2.0, 2.0])
xreg = np.random.RandomState(1).rand(y.shape[0], 3)
# Try for cv on/off, various D levels, and various Xregs
for d in (0, 1):
for cv in (0, 3):
for exog in (xreg, None):
# surround with try/except so we can log the failing combo
try:
model = ARIMA(order=(1, d, 1),
out_of_sample_size=cv).fit(y, exogenous=exog)
# If exogenous is defined, we need to pass n_periods of
# exogenous rows to the predict function. Otherwise we'll
# just leave it at None
if exog is not None:
xr = exog[:3, :]
else:
xr = None
_, _ = model.predict(n_periods=3, return_conf_int=True,
exogenous=xr)
except Exception:
print("Failing combo: d=%i, cv=%i, exog=%r"
% (d, cv, exog))
raise The changes that make this functional are going to be released with v0.7.0 |
Description
TypeError: predict() got an unexpected keyword argument 'typ'
raised whenseasonal=False
, CV is performed (i.e.out_of_sample_size
is passed) and ad
of0
is selected byauto_arima
.I think this is because an ARMA model doesn't take a
typ
argument, but heretyp='linear'
is being passed.Steps/Code to Reproduce
Versions
Linux-4.15.0-29-generic-x86_64-with-debian-buster-sid
Python 3.5.5 (default, Jul 24 2018, 13:20:46)
[GCC 7.3.0]
Pyramid 0.6.5
NumPy 1.15.0
SciPy 1.1.0
Scikit-Learn 0.19.2
Statsmodels 0.9.0
The text was updated successfully, but these errors were encountered: