The training period in Elementary is affected by several factors, especially when seasonality is configured. When you set seasonality to day_of_week and specify days_back: 7, the documentation states that days_back will be multiplied by 7, so you would expect 49 days to be used as the training period. This is to ensure there are enough data points for each day of the week (i.e., 7 weeks of Mondays, Tuesdays, etc.) [Seasonality configuration](
https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/seasonality). However, the actual training period shown in the report (e.g., 39 days instead of 49) can be less than this calculated value due to the following reasons: -
Full time buckets: Elementary will adjust the training period to ensure full time buckets are used. For example, if your time buckets do not align perfectly with the period you specified, Elementary may shorten the window to only include complete buckets [Training period documentation](
https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/training-period). -
Data availability: If there is not enough data in your table to fill the expected training period (e.g., missing days or incomplete data), the actual training period may be less than the theoretical maximum. -
Implementation details: There may be additional logic in the code to avoid including partial buckets or to handle edge cases, which can result in a training period that is less than the simple multiplication of days_back by 7. In summary, while the docs state that days_back is multiplied by 7 when using day_of_week seasonality, the actual training period may be less due to the need for full time buckets and the availability of data. If you consistently see a lower number, it is likely due to these adjustments for full buckets or missing data, as described in the documentation. If you need a precise explanation for your specific case, reviewing the data coverage in your source table and the alignment of your time buckets may help clarify the discrepancy. If you need further clarification, please provide more details about your data and configuration, or consult the Elementary documentation for more on how training periods are calculated with seasonality [Training period documentation](
https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/training-period).