How do you evaluate a model using a cost matrix instead of standard thresholded classification metrics?

Quick Overview

Asks how to evaluate a classifier with a cost matrix that prices each kind of error, in place of accuracy or F1. Tests the expected-cost decision rule, the cost-derived threshold, calibration, baseline comparisons and sensitivity analysis when business costs are uncertain.

How do you evaluate a model using a cost matrix instead of standard thresholded classification metrics?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How do you evaluate a model using a cost matrix instead of standard thresholded classification metrics? Assume a setting where different mistakes have very different consequences, such as missing a fraudulent transaction versus sending a legitimate one to manual review. ```hint Two jobs for one matrix The costs can do more than score the model. Think about what they imply for where you put the decision threshold. ``` ```hint Check the inputs An expected-cost rule multiplies probabilities by costs. Ask what property the probabilities need for that product to mean anything. ``` ### What a Strong Answer Covers - How the cost matrix is defined and where its entries come from - The expected-cost decision rule, the binary threshold it implies, and why calibration matters - How to compute and report realized cost, with baselines and uncertainty - What to do when the costs are uncertain or vary from one example to another ### Follow-up Questions - How would you handle costs that depend on the example, such as the transaction amount? - What happens to the cost-optimal threshold if the probabilities are miscalibrated, and how would you detect it? - How would you choose between two models whose ranking flips as the cost ratio changes? - How does the evaluation change when analysts can review only a fixed number of cases per day?

Overview: Asks how to evaluate a classifier with a cost matrix that prices each kind of error, in place of accuracy or F1. Tests the expected-cost decision rule, the cost-derived threshold, calibration, baseline comparisons and sensitivity analysis when business costs are uncertain.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How do you evaluate a model using a cost matrix instead of standard thresholded classification metrics?

Assume a setting where different mistakes have very different consequences, such as missing a fraudulent transaction versus sending a legitimate one to manual review.

What a Strong Answer Covers Guidance

  • How the cost matrix is defined and where its entries come from
  • The expected-cost decision rule, the binary threshold it implies, and why calibration matters
  • How to compute and report realized cost, with baselines and uncertainty
  • What to do when the costs are uncertain or vary from one example to another

Follow-up Questions Guidance

  • How would you handle costs that depend on the example, such as the transaction amount?
  • What happens to the cost-optimal threshold if the probabilities are miscalibrated, and how would you detect it?
  • How would you choose between two models whose ranking flips as the cost ratio changes?
  • How does the evaluation change when analysts can review only a fixed number of cases per day?