Databricks Certified Machine Learning Professional free question 8 / 10 · Domain 2: MLOps
A team writes the definition of a custom metric. Which definition matches the rules in the Databricks documentation for the definition parameter?
- A single SQL column expression written as a Jinja template, such as avg(f1 - f2).
- A Python function that receives the DataFrame of the window and returns a score.
- A SQL query that joins the primary table to a lookup table and returns one number.
- A SELECT statement with a subquery that computes the label average first.
Show the answer and explanation
Answer: A
Why this is correct
To define a custom metric, you write a Jinja template for a SQL column expression. The definition parameter must be a single string expression and cannot contain joins or subqueries. The template can use parameters such as the input column, the prediction column, the label column, and for drift metrics the current and baseline values. An expression such as avg(f1 - f2) follows these rules.
Why the other options are wrong
"A SQL query that joins the primary table to a lookup table and returns one number." … The definition cannot contain joins.
"A SELECT statement with a subquery that computes the label average first." … The definition cannot contain subqueries.
"A Python function that receives the DataFrame of the window and returns a score." … The definition is a Jinja template for a SQL column expression, not a Python function.
Definition rules
One SQL column expression, no joins and no subqueries.