Thanks to visit codestin.com
Credit goes to github.com

Skip to content

forecaster.preprocess() may introduce unwanted behavior for NaN history values in 1.1.5 #2518

@imad24

Description

@imad24

I have noticed that the changes made to this line may introduce unwanted behavior in the future dataframe:

self.history_dates = pd.to_datetime(pd.Series(history['ds'].unique(), name='ds')).sort_values()

This will make make_future_dataframe() ignore the dates with NaN values in the history, considering

history = df[df['y'].notnull()].copy()

in the versions prior to 1.1.5 (for reference):

self.history_dates = pd.to_datetime(pd.Series(df['ds'].unique(), name='ds')).sort_values()

Notice that the dataframe df['ds'].unique()is used instead of the not null history['ds'].unique()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions