QuestionQ105

VerifiedDrift Detection and Lakehouse Monitoring

A Data Scientist must monitor a production-deployed classification model using Databricks Lakehouse Monitoring. The model predicts loan approvals, and the data scientist needs to check for bias by comparing model performance for applicants younger than 25 with applicants aged 25 or older. The inference logs are stored in a Delta table at loan_inference_log_path. The relevant columns are:

  • age (integer)
  • prediction (integer: 1 for approved, 0 for denied)
  • label (integer: 1 for approved, 0 for denied)
  • timestamp (timestamp of inference)

The data scientist needs to assess fairness metrics, including predictive parity and equal opportunity, for the protected group (age < 25) and detect drift in these metrics at weekly intervals.

Which code snippet correctly configures the monitor to assess drift and fairness metrics by age group?

Explanation

Databricks fairness metrics for classification apply to an InferenceLog analysis with problem_type="classification". Providing the prediction and label columns enables label-dependent metrics such as predictive parity and equal opportunity. The timestamp column with weekly granularity produces weekly windows for drift analysis, and slicing_exprs=["age < 25"] creates the protected-group slice and its complementary age-25-or-older slice.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!