how to check the value of anomoly detction i mean ...
# ask-elementary-ai
s
how to check the value of anomoly detction i mean the standard deviation in the schema tables
k
A message from kapa.ai
You can inspect the underlying anomaly calculations directly in Elementary’s warehouse tables/views. ### 1. Where standard deviation is stored For anomaly tests, Elementary first aggregates metrics into: -
data_monitoring_metrics
– stores the raw metric values per bucket (e.g. per day/hour) for each anomaly test. [[DBT artifacts](https://slack.com/archives/C02CTC89LAX/p1663047264555179); [Tables overview](https://slack.com/archives/C02CTC89LAX/p1666376716952649)] Standard deviation and other training stats (avg, training set size, etc.) are then calculated in: -
metrics_anomaly_score
– a model/view that reads from
data_monitoring_metrics
and computes: -
training_avg
-
training_stddev
-
training_set_size
-
anomaly_score
[[Anomaly scores SQL](https://slack.com/archives/C02CTC89LAX/p1687939167177509); [Tables overview](https://slack.com/archives/C02CTC89LAX/p1666376716952649)] Per‑test temporary tables ending with
__anomaly_scores
in the
elementary__tests
schema also contain
training_stddev
,
training_avg
,
min_metric_value
,
max_metric_value
, etc. [[Per‑test scores](https://slack.com/archives/C02CTC89LAX/p1687939167177509)] ### 2. Example queries a. See all training stddev values from the central model:
Copy code
sql SELECT   full_table_name,   column_name,   metric_name,   bucket_start,   bucket_end,   metric_value,   training_avg,   training_stddev,   training_set_size,   anomaly_score FROM <db>.<elementary_schema>.metrics_anomaly_score ORDER BY bucket_end DESC;
b. Check the raw metrics going into the calculation:
Copy code
sql SELECT   full_table_name,   column_name,   metric_name,   bucket_start,   bucket_end,   metric_value,   updated_at FROM <db>.<elementary_schema>.data_monitoring_metrics ORDER BY bucket_end DESC;
c. Look at a specific anomaly test’s own
__anomaly_scores
table (if you know its name):
Copy code
sql SELECT   anomaly_score,   anomaly_score_threshold,   training_avg,   training_stddev,   min_metric_value,   max_metric_value,   bucket_start,   metric_value FROM <db>.<elementary_tests_schema>.<some_test_name__anomaly_scores> ORDER BY bucket_start DESC;
In all cases,
training_stddev
is the standard deviation Elementary uses to compute the z‑score–based
anomaly_score
. [[Anomaly method](https://docs.elementary-data.com/data-tests/data-anomaly-detection); [Anomaly scores SQL](https://slack.com/archives/C02CTC89LAX/p1687939167177509)]