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

[BUG] Why is the inverse transformation of the target not applied? #2771

Closed
ngupta23 opened this issue Jul 18, 2022 Discussed in #2706 · 4 comments · Fixed by #2847
Closed

[BUG] Why is the inverse transformation of the target not applied? #2771

ngupta23 opened this issue Jul 18, 2022 Discussed in #2706 · 4 comments · Fixed by #2847
Assignees
Labels
bug Something isn't working preprocessing priority_high time_series Topics related to the time series

Comments

@ngupta23
Copy link
Collaborator

Discussed in #2706

Originally posted by acartro July 4, 2022
Good morning,

I am doing a time series experiment with the new 3.0 library. I have found that when I set the setup to do a logarithmic transformation of the target (transform_target='log') when making the forecasts, it applies the inverse transformation.

Whit target transformation

from pycaret.time_series import *
from pycaret.datasets import get_data
y = get_data("airline")

#### Setup experiment ----
exp = TSForecastingExperiment()
exp.setup(data=y, fh=12, session_id=42, transform_target='log')

##### List the available models ----
exp.models()

#### Create a model from available models ----
model = exp.create_model("arima")

### plot model
exp.plot_model(model )

image

Whit target transformation and impute missings

But when I set the setup to do an imputation of the missings and then the logarithmic transformation (transform_target='log', numeric_imputation_target='drift'), when it makes the forecast, it doesn't apply the inverse transformation.

#### Setup experiment ----
exp = TSForecastingExperiment()
exp.setup(data=y, fh=12, session_id=42, transform_target='log',
          numeric_imputation_target='drift')

##### List the available models ----
exp.models()

#### Create a model from available models ----
model = exp.create_model("arima")

### plot model
exp.plot_model(model )

image

Does anyone know why this is happening or am I just doing the forecast wrong?

@ngupta23 ngupta23 added bug Something isn't working time_series Topics related to the time series preprocessing labels Jul 18, 2022
@ngupta23
Copy link
Collaborator Author

Also see: #2724

@ngupta23 ngupta23 changed the title Why is the inverse transformation of the target not applied? I think it's a bug [BUG] Why is the inverse transformation of the target not applied? Jul 18, 2022
@ngupta23
Copy link
Collaborator Author

I am able to reproduce this. Will need to dig deeper and get back to you.

https://gist.github.com/ngupta23/981f287598761e69767a0c17d4a465b5

@ngupta23 ngupta23 self-assigned this Jul 18, 2022
@ngupta23 ngupta23 added this to To do in Time Series Forecasting via automation Jul 18, 2022
@ngupta23 ngupta23 added this to the pycaret 3.0.0rc4 milestone Jul 18, 2022
@ngupta23
Copy link
Collaborator Author

ngupta23 commented Jul 24, 2022

@acartro @thebetauser This seems to be a bug in sktime. I have opened an issue in their repository and will wait for their response

sktime/sktime#3084

@ngupta23
Copy link
Collaborator Author

ngupta23 commented Aug 2, 2022

The issue is fixed in sktime (unreleased version). This should be fixed with the next release of sktime and pycaret.

ngupta23 added a commit that referenced this issue Aug 12, 2022
Time Series Forecasting automation moved this from To do to Done Aug 13, 2022
ngupta23 added a commit that referenced this issue Aug 13, 2022
Updated sktime to 0.13.1 to fix #2771
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working preprocessing priority_high time_series Topics related to the time series
Development

Successfully merging a pull request may close this issue.

1 participant