Databricks ML Professional Practice Question 16: Custom Metric Types
Databricks Certified Machine Learning Professional · Test 2 · question 6 of 10
A data profile runs on an inference table with a baseline table configured. The team needs two things beyond the built-in metrics: a revenue-weighted error figure computed from the table's own columns for each time window, and a comparison of that same figure between the current window and the baseline.
How should the custom metrics be defined?
Show answer and explanation
Answer:
Custom metrics come in three types, and they compose in a fixed order. An *aggregate* metric is computed from columns of the primary table over each time window; the revenue-weighted error is exactly that. A *derived* metric is computed from already-computed aggregate metrics in the same window, without touching the table again. A *drift* metric compares an aggregate or derived metric across two windows, or between the primary table and the baseline table, and its results land in the drift metrics table rather than the profile metrics table. So the figure is defined as an aggregate, and the baseline comparison is a drift metric built on top of it.
Option B inverts two of the three definitions. A derived metric cannot read the table's columns, so it cannot produce the figure in the first place, and an aggregate metric never performs a baseline comparison.
Option C produces two independent numbers and no comparison. Aggregate metrics are computed per window on the primary table; nothing in that type expresses a relationship between the two tables, so the team would be left to diff the rows themselves.
Option D asks one metric to do both jobs. A drift metric operates on previously computed metrics, not on raw columns, so the aggregate it compares must already be defined.
Reference: Custom metrics for data profiling