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

Update forecaster.py #2514

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions python/prophet/forecaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def regressor_column_matrix(self, seasonal_features, modes):
if name not in component_cols:
component_cols[name] = 0
# Remove the placeholder
component_cols.drop('zeros', axis=1, inplace=True, errors='ignore')
components_cols = component_cols.drop('zeros', axis=1, errors='ignore')
# Validation
if (max(component_cols['additive_terms']
+ component_cols['multiplicative_terms']) > 1):
Expand Down Expand Up @@ -1828,7 +1828,7 @@ def percentile(self, a, *args, **kwargs):
return fn(a, *args, **kwargs)

def make_future_dataframe(self, periods, freq='D', include_history=True):
"""Simulate the trend using the extrapolated generative model.
"""Create a future dataframe for forecasting.

Parameters
----------
Expand All @@ -1853,10 +1853,9 @@ def make_future_dataframe(self, periods, freq='D', include_history=True):
last_date = self.history_dates.max()
dates = pd.date_range(
start=last_date,
periods=periods + 1, # An extra in case we include start
periods=periods + 1,
freq=freq)
dates = dates[dates > last_date] # Drop start if equals last_date
dates = dates[:periods] # Return correct number of periods
dates = dates[dates > last_date]

if include_history:
dates = np.concatenate((np.array(self.history_dates), dates))
Expand Down