@@ -29,6 +29,8 @@ def __init__(
29
29
weekly_seasonality : Union [bool , int ] = "auto" ,
30
30
daily_seasonality : Union [bool , int ] = "auto" ,
31
31
add_seasonality = "auto" ,
32
+ seasonality_mode = "additive" ,
33
+ holidays = None ,
32
34
uncertainty_samples : int = 100 ,
33
35
** kwargs ,
34
36
):
@@ -53,7 +55,14 @@ def __init__(
53
55
deactivated otherwise. If int, this is the number of Fourier series
54
56
components used to model the seasonality (default = 4).
55
57
:param add_seasonality: 'auto' indicates automatically adding extra
56
- seasonaltiy by detection methods (default = None).
58
+ seasonality by detection methods (default = None).
59
+ :param seasonality_mode: 'additive' (default) or 'multiplicative'.
60
+ :param holidays: pd.DataFrame with columns holiday (string) and ds (date type)
61
+ and optionally columns lower_window and upper_window which specify a
62
+ range of days around the date to be included as holidays.
63
+ lower_window=-2 will include 2 days prior to the date as holidays. Also
64
+ optionally can have a column prior_scale specifying the prior scale for
65
+ that holiday.
57
66
:param uncertainty_samples: The number of posterior samples to draw in
58
67
order to calibrate the anomaly scores.
59
68
"""
@@ -62,7 +71,9 @@ def __init__(
62
71
self .weekly_seasonality = weekly_seasonality
63
72
self .daily_seasonality = daily_seasonality
64
73
self .add_seasonality = add_seasonality
74
+ self .seasonality_mode = seasonality_mode
65
75
self .uncertainty_samples = uncertainty_samples
76
+ self .holidays = holidays
66
77
67
78
68
79
class Prophet (ForecasterBase ):
@@ -79,7 +90,9 @@ def __init__(self, config: ProphetConfig):
79
90
yearly_seasonality = self .yearly_seasonality ,
80
91
weekly_seasonality = self .weekly_seasonality ,
81
92
daily_seasonality = self .daily_seasonality ,
93
+ seasonality_mode = self .seasonality_mode ,
82
94
uncertainty_samples = self .uncertainty_samples ,
95
+ holidays = self .holidays ,
83
96
)
84
97
self .last_forecast_time_stamps_full = None
85
98
self .last_forecast_time_stamps = None
@@ -111,6 +124,14 @@ def daily_seasonality(self):
111
124
def add_seasonality (self ):
112
125
return self .config .add_seasonality
113
126
127
+ @property
128
+ def seasonality_mode (self ):
129
+ return self .config .seasonality_mode
130
+
131
+ @property
132
+ def holidays (self ):
133
+ return self .config .holidays
134
+
114
135
@property
115
136
def uncertainty_samples (self ):
116
137
return self .config .uncertainty_samples
0 commit comments