Skip to content
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

boxcox cannot de-exponentiate in a pipeline. #558

Open
adamd1985 opened this issue Aug 27, 2023 · 0 comments
Open

boxcox cannot de-exponentiate in a pipeline. #558

adamd1985 opened this issue Aug 27, 2023 · 0 comments

Comments

@adamd1985
Copy link

Describe the bug

[pmdarima\preprocessing\endog\boxcox.py:165](file:///C:/Users/worker/.conda/envs/tjoe/lib/site-packages/pmdarima/preprocessing/endog/boxcox.py:165): RuntimeWarning: invalid value encountered in power
  de_exp = numer ** (1. / lam1)  # de-exponentiate

To Reproduce

Happens all the time with pipelines, unless lambda1 is 0, this is an example setup:

from pmdarima.pipeline import Pipeline
from pmdarima.arima import auto_arima

model = Pipeline([
    ('boxcox', BoxCoxEndogTransformer(lmbda=0)),
    ('arima', auto_arima(y_train['Close'], d=n_diffs, trace=True, stepwise=True,
     seasonal=True, m=12, stationary=False, suppress_warnings=True, error_action="ignore", n_jobs=1))
])
model.fit(y_train['Close'])
...
c, conf_int = model.predict(
        n_periods=1, return_conf_int=True, inverse_transform=True)

Doesn't happen when called directly.

Use any large timeseries (e.g. a market index) to replicate, e.g.:

[{"FromDate":"2023-08-08T03:15:00Z","Open":15367.3,"High":15369.1,"Low":15349.2,"Close":15351.8,"Volume":null},{"FromDate":"2023-08-08T03:30:00Z","Open":15352.0,"High":15355.7,"Low":15348.6,"Close":15352.6,"Volume":null},{"FromDate":"2023-08-08T03:45:00Z","Open":15352.2,"High":15360.1,"Low":15351.7,"Close":15353.3,"Volume":null},{"FromDate":"2023-08-08T04:00:00Z","Open":15353.2,"High":15356.1,"Low":15350.8,"Close":15355.5,"Volume":null},{"FromDate":"2023-08-08T04:15:00Z","Open":15355.6,"High":15360.0,"Low":15354.2,"Close":15358.1,"Volume":null},
...
]

Versions

version: pmdarima  2.0.3  pypi_0 pypi

Expected Behavior

No errors, de-Exp happens correctly.

Actual Behavior

no de-exp happens, predicted value is correct but normalized.

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant