in orbit/template/ktrlite.py [0:0]
def _set_seasonality_attributes(self):
"""given list of seasonalities and their order, create list of seasonal_regressors_columns"""
self.regressor_col_grp = list()
self.regressor_col = list()
self.coefficients_initial_knot_scale = list()
self.coefficients_knot_scale = list()
if len(self._seasonality) > 0:
for idx, s in enumerate(self._seasonality):
fs_cols = []
order = self._seasonality_fs_order[idx]
self.coefficients_initial_knot_scale += (
[self._seasonal_initial_knot_scale[idx]] * order * 2
)
self.coefficients_knot_scale += (
[self._seasonal_knot_scale[idx]] * order * 2
)
for i in range(1, order + 1):
fs_cols.append("seas{}_fs_cos{}".format(s, i))
fs_cols.append("seas{}_fs_sin{}".format(s, i))
# flatten version of regressor columns
self.regressor_col += fs_cols
# list of group of regressor columns bundled with seasonality
self.regressor_col_grp.append(fs_cols)
self.num_of_regressors = len(self.regressor_col)