Initialize flat growth. Provides a strong initialization for flat growth. Sets the growth to 0 and offset parameter as mean of history y_scaled values. Parameters ---------- df: pd.DataFrame with columns ds (date), y_scaled (scaled time series),
(df)
| 1099 | |
| 1100 | @staticmethod |
| 1101 | def flat_growth_init(df): |
| 1102 | """Initialize flat growth. |
| 1103 | |
| 1104 | Provides a strong initialization for flat growth. Sets the growth to 0 |
| 1105 | and offset parameter as mean of history y_scaled values. |
| 1106 | |
| 1107 | Parameters |
| 1108 | ---------- |
| 1109 | df: pd.DataFrame with columns ds (date), y_scaled (scaled time series), |
| 1110 | and t (scaled time). |
| 1111 | |
| 1112 | Returns |
| 1113 | ------- |
| 1114 | A tuple (k, m) with the rate (k) and offset (m) of the linear growth |
| 1115 | function. |
| 1116 | """ |
| 1117 | k = 0 |
| 1118 | m = df['y_scaled'].mean() |
| 1119 | return k, m |
| 1120 | |
| 1121 | def preprocess(self, df: pd.DataFrame, **kwargs) -> ModelInputData: |
| 1122 | """ |
no outgoing calls