The recommended number of days for the training period in Elementary anomaly detection tests is 14 days by default. This default is chosen to provide a balance between having enough historical data for reliable anomaly detection and not making the model too insensitive to recent changes. - If you
increase the training period (e.g., 30 days), the test will be less sensitive to outliers, reducing false positives but potentially missing subtle anomalies. - If you
decrease the training period (e.g., less than 14 days), the test becomes more sensitive, which can lead to more false positives. It's generally not recommended to set the training period to less than 14 days, as this can cause false positives. However, you can adjust this value based on your data's characteristics and how sensitive you want the anomaly detection to be. For example, if your data is highly volatile, a longer training period may help smooth out noise. If you want to catch anomalies more quickly, a shorter period may be appropriate, but be aware of the increased risk of false alerts. Also, if you use seasonality (e.g.,
day_of_week
), Elementary may automatically increase the training period to ensure enough data points for each seasonality bucket (e.g., enough Mondays, Tuesdays, etc.) to make accurate calculations [training_period documentation](
https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/training-period). In summary:
14 days is the default and generally recommended minimum. Adjust upwards for less sensitivity and fewer false positives, or downwards for more sensitivity (with caution). Consider your data's update frequency and seasonality when making this decision.