How can you compare two density estimators when you do not know the true underlying distribution?

Quick Overview

Asks how to decide which of two density estimators fits the data better when the true distribution is unknown. Tests understanding of held-out likelihood and its link to KL divergence, a fair evaluation protocol, and checks that go beyond likelihood.

How can you compare two density estimators when you do not know the true underlying distribution?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

You have fit two density estimators to the same data, for example a kernel density estimate and a Gaussian mixture. How can you compare two density estimators when you do not know the true underlying distribution? ```hint Start from a divergence Write the KL divergence from the true distribution to a model and look at which of its terms depends on the model. ``` ```hint Watch the evaluation data Think about what a kernel density estimate with a tiny bandwidth scores on the same points it was fit to. ``` ### What a Strong Answer Covers - A score that works without knowing the true density, and why it ranks models correctly - Why that score must be computed on held-out data - A sound protocol: same splits, normalized densities in comparable units, and a measure of uncertainty - Checks that complement the likelihood score - Cases where likelihood and sample quality disagree, and choosing the metric by use case ### Follow-up Questions - How do you compare a model of 8-bit pixel values with a continuous density model on the same images? - One model was fit on standardized features and the other on raw features. Can you compare their log-likelihoods directly? - A single test point gets an extremely low log-density under one model. How should that affect the comparison? - When would you prefer a sample-based test over held-out likelihood?

Overview: Asks how to decide which of two density estimators fits the data better when the true distribution is unknown. Tests understanding of held-out likelihood and its link to KL divergence, a fair evaluation protocol, and checks that go beyond likelihood.

Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

You have fit two density estimators to the same data, for example a kernel density estimate and a Gaussian mixture. How can you compare two density estimators when you do not know the true underlying distribution?

What a Strong Answer Covers Guidance

  • A score that works without knowing the true density, and why it ranks models correctly
  • Why that score must be computed on held-out data
  • A sound protocol: same splits, normalized densities in comparable units, and a measure of uncertainty
  • Checks that complement the likelihood score
  • Cases where likelihood and sample quality disagree, and choosing the metric by use case

Follow-up Questions Guidance

  • How do you compare a model of 8-bit pixel values with a continuous density model on the same images?
  • One model was fit on standardized features and the other on raw features. Can you compare their log-likelihoods directly?
  • A single test point gets an extremely low log-density under one model. How should that affect the comparison?
  • When would you prefer a sample-based test over held-out likelihood?