Noam Moskowitz
01/16/2025, 2:48 PMall_columns_anomalies test running against an aggregated table, where each column represents an aggregation of event data.
Due to the fact that each column represents a different aspect we want to aggregate, and each column may have different dates where we know peaks occur, we want to exclude these peaks to ensure the expected values aren't skewed.
What would be the best practice to handle this scenario?
Thanks!Noya Offer
01/19/2025, 9:08 AMNoam Moskowitz
01/19/2025, 9:43 AMall_columns_anomalies, which currently runs against 70 columns and is expected to expand in the future.
Attached below is a screenshot illustrating the issue. You can see how the peaks create a broader window of expected values.
We are trying to think of an automation for removing or ignoring these peaks.
Thanks!Noya Offer
01/19/2025, 2:50 PManomaly_exclude_metrics , where you can exclude either by dates, time buckets or values. This way, these metrics won't be included in the expected range calculation. If you know the peak dates, you can use this to ignore them. It's a difficult problem because the peak dates/peak values vary for each column.
Do you have any way to group the columns into separate views so you don't need to set individual tests per column?Noam Moskowitz
01/19/2025, 2:57 PM- name: features_usage_per_day
description: "aggregate feature usage per day, each field represent the usage of the a specific feature Total fields is 70"
tests:
- elementary.all_columns_anomalies:
meta:
description: "Check for anomalies in all usage-numeric columns"
exclude_regexp: "^(usage_date)$"
training_period:
period: day
count: 168
anomaly_sensitivity: 4
timestamp_column: usage_date
seasonality: day_of_week
detection_period:
period: day
count: 1
time_bucket:
period: day
count: 1
column_anomalies:
- average
tags: ['daily_anomalies']
I saw the anomaly_exclude_metrics its pretty manual even if i split them up into view, i would maybe go back and alter the result instead of excluding them.
1. How would you recommend to approach this?
2. What is considered to be best practice regarding the orchestration of the elementary anomaly tests? The issue we are currently struggling with is that we trigger them in the same job, causing the job itself to be very long, is there a way to work paralel?Noam Moskowitz
01/27/2025, 7:15 AMNoya Offer
01/27/2025, 3:29 PMexclude_anomalies_in_training would make sense, or maybe add features to anomaly_exclude_metrics (ignore a certain range of standard deviation). If you are up for we are happy to discuss open source contribution.
As for the second question, not sure which orchestrator you're using, but I would suggest the typical dbt best practices around triggering, leveraging things like tags or other parameters to use in your —select field.
https://docs.getdbt.com/reference/commands/test