MCPcopy Index your code
hub / github.com/facebook/prophet / seasonality_plot_df

Function seasonality_plot_df

python/prophet/plot.py:252–273  ·  view source on GitHub ↗

Prepare dataframe for plotting seasonal components. Parameters ---------- m: Prophet model. ds: List of dates for column ds. Returns ------- A dataframe with seasonal components on ds.

(m, ds)

Source from the content-addressed store, hash-verified

250
251
252def seasonality_plot_df(m, ds):
253 """Prepare dataframe for plotting seasonal components.
254
255 Parameters
256 ----------
257 m: Prophet model.
258 ds: List of dates for column ds.
259
260 Returns
261 -------
262 A dataframe with seasonal components on ds.
263 """
264 df_dict = {'ds': ds, 'cap': 1., 'floor': 0.}
265 for name in m.extra_regressors:
266 df_dict[name] = 0.
267 # Activate all conditional seasonality columns
268 for props in m.seasonalities.values():
269 if props['condition_name'] is not None:
270 df_dict[props['condition_name']] = True
271 df = pd.DataFrame(df_dict)
272 df = m.setup_dataframe(df)
273 return df
274
275
276def plot_weekly(m, ax=None, uncertainty=True, weekly_start=0, figsize=(10, 6), name='weekly'):

Callers 4

plot_weeklyFunction · 0.85
plot_yearlyFunction · 0.85
plot_seasonalityFunction · 0.85

Calls 1

setup_dataframeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…