Anomaly detection and forecasting with KQL
By now, you should have a good understanding of the different components of time series such as seasonality, trends, and variations. KQL provides the series_decompose()
function to calculate the values of these components for a given time series.
The series_decompose()
function expects one required argument and four optional arguments. Let's look at these arguments in more detail:
series
is the time series we would like to calculate the components for.seasonality
is set to-1
to have the function autodetect the seasonality,0
to skip the seasonality analysis, or a positive integer to specify the expected period. The default value is-1
(auto-detect).trend
determines the type of trend analysis that's performed. There are three options we can specify at the time of writing:avg
specifies the average bins for the trend.linefit
specifies linear regression, which we learned about earlier, by usingseries_fit_line...