Module quiz

Evaluation, statistics and data quiz

65 questions across 3 lessons. Choose an answer, check it, and read why each option is right or wrong.

Checking answers needs JavaScript. You can still read every question and option below.

0 of 65 answered

Keyboard: arrow keys move between options. Space or Enter selects the focused option.

Evaluation, leakage and imbalance: validation design, metrics, thresholds and rare classes18 questions

ObjectiveChoose a validation scheme (stratified, group, time-series or plain k-fold) from how the rows of a dataset relate to each other, and explain why the test set is used once.

  1. Question 1 of 65A team has 100 patients with 5 visits each. The label is a coin flip per patient, so no feature can really predict it. A 1-nearest-neighbour model scores 0.94 under random row-level 5-fold and 0.49 under group 5-fold. What explains the gap?

    Choose one answer.

  2. Question 2 of 65You forecast tomorrow's demand per store. Features include a 7-day rolling average of sales that ends on the row's own date, and the target is next-day sales. Which validation setup is most defensible?

    Choose one answer.

  3. Question 3 of 65Which statements about cross-validation splitters are true? Select all that apply.

    Choose all that apply.

  4. Question 4 of 65A team compares 20 model configurations with 5-fold cross-validation, picks the best (score 0.84) and reports 0.84 as the accuracy to expect in production. What is the main problem?

    Choose one answer.

ObjectiveName the main kinds of leakage (target, preprocessing before the split, shared entities or duplicates, temporal, resampling before the split), say how each shows up, and say how to prevent it.

  1. Question 5 of 65You have 100 rows, 2,000 features and a label that is a coin flip. You pick the 10 features most correlated with the label using all rows, then split and train. The test accuracy is 0.82. With selection on the training rows only it is 0.49. What does this show?

    Choose one answer.

  2. Question 6 of 65Which of these are leakage? Select all that apply.

    Choose all that apply.

  3. Question 7 of 65A fraud team has a rare positive class. Which workflow reports a trustworthy validation score?

    Choose one answer.

  4. Question 8 of 65A readmission model reaches 0.98 AUC on a random row-level split. Feature importance shows one feature, discharge disposition, carries most of the weight, and the same patients return in several admissions. Which two repairs do you make first?

    Choose one answer.

ObjectivePick metrics for a classifier (accuracy, precision, recall, F1, ROC-AUC against PR-AUC, log loss, calibration) and for a regressor, compute them from a confusion matrix, and choose a decision threshold from error costs.

  1. Question 9 of 65Out of 10,000 transactions, 20 are fraud. Model C flags 30 and catches 12. Model D flags 100 and catches 19. A miss costs 1,000 and a false alarm 20. Which is true?

    Choose one answer.

  2. Question 10 of 65A model's ROC-AUC is 0.91 on a test set with equal numbers of positives and negatives. Live traffic has 500 negatives for every positive, from the same distribution. What do you expect for the same model and threshold?

    Choose one answer.

  3. Question 11 of 65A calibrated model flags loan applications for manual checks. A missed bad application costs 2,000 and an unnecessary check costs 40. At what predicted probability does flagging become the cheaper choice?

    Choose one answer.

  4. Question 12 of 65Which statements about calibration are true? Select all that apply.

    Choose all that apply.

  5. Question 13 of 65Five forecasts miss by 2, 2, 2, 2 and 40 units. Your stakeholders say one very large miss is far worse than several small ones. Which metric reflects that best, and what are the two values?

    Choose one answer.

  6. Question 14 of 65A classifier produces TP = 30, FP = 70, FN = 10 and TN = 9,890. What are its precision, recall and F1?

    Choose one answer.

ObjectiveHandle a rare class in the right order (baseline, metric, class weights, threshold, resampling inside the folds, recalibration), state the caveats of SMOTE, and run error analysis by slice.

  1. Question 15 of 65A team has a 0.1% positive rate. They train with positives weighted by 999 and tune the threshold on validation data. The scores rank well, but the team plans to show the raw score as "chance of default" to customers. What should they do first?

    Choose one answer.

  2. Question 16 of 65Which statements about handling a rare class are true? Select all that apply.

    Choose all that apply.

  3. Question 17 of 65A model reports 92.5% accuracy overall. Slicing by data source shows 95% on a source with 9,000 rows and 70% on a source with 1,000 rows. What is the best next step?

    Choose one answer.

  4. Question 18 of 65On a test set with 0.2% positives, a model has an average precision of 0.09 and the most-frequent baseline has 99.8% accuracy. How should the model be judged?

    Choose one answer.

Statistics and experimentation: intervals, tests, power, A/B tests and fair model comparison23 questions

ObjectiveExplain an estimator, its bias and variance, and a confidence interval, and compute an analytic and a bootstrap interval while knowing when each one is unreliable.

  1. Question 19 of 65You draw 4,000 samples of size 5 from a right-skewed distribution with mean 1 and standard deviation 1. The standard deviation of the sample means is 0.453, close to the theoretical 0.447. Yet only 0.1% of the means fall below 1 - 1.96 x 0.447, while 4.4% fall above 1 + 1.96 x 0.447. What does this show?

    Choose one answer.

  2. Question 20 of 65A report says: "the 95% interval for the mean session length is (4.1, 8.8) minutes." Which reading is correct?

    Choose one answer.

  3. Question 21 of 65For samples of size 5 from a distribution with true variance 1, the average of the sum of squared deviations divided by n is 0.798, and divided by n - 1 it is 0.997. What follows?

    Choose one answer.

  4. Question 22 of 65Estimating a mean of 0.5 from 10 draws with standard deviation 1, the sample mean has mean squared error about 0.100. Multiplying it by 0.8 gives about 0.074. How is that possible when the second estimator is biased?

    Choose one answer.

  5. Question 23 of 65Which statements about bootstrap and analytic confidence intervals are true? Select all that apply.

    Choose all that apply.

ObjectiveChoose and run a z, chi-square or permutation test, and say what a p-value, a type I error, a type II error and power mean, including the standard misreadings.

  1. Question 24 of 65A colleague says a result with p = 0.03 means there is a 97% chance that the effect is real. What is the best correction?

    Choose one answer.

  2. Question 25 of 65The same conversion rates (10.0% against 10.9%) give p = 0.0375 with 10,000 users per arm and p = 0.3522 with 2,000 per arm. What is the right interpretation?

    Choose one answer.

  3. Question 26 of 65You have 9 and 11 revenue values per user from two small groups, with one huge outlier in each, and you cannot justify a normal model. Which test is the most defensible, and why?

    Choose one answer.

  4. Question 27 of 65A randomised permutation test with 9,999 shuffles finds no shuffled difference as large as the observed one. Why is its reported p-value 1 / 10,000 and not 0?

    Choose one answer.

  5. Question 28 of 65Which statements about errors and power are true? Select all that apply.

    Choose all that apply.

ObjectiveSize an experiment from a baseline, a minimum effect, alpha and power, and control false positives from many comparisons (Bonferroni, Benjamini-Hochberg) and from peeking.

  1. Question 29 of 65A baseline conversion rate is 10%. Detecting a lift to 11% needs 14,749 users per arm at alpha 0.05 and power 0.8. About how many are needed to detect a lift to 10.5%?

    Choose one answer.

  2. Question 30 of 65A test of 0.30 against 0.35 with 500 users per arm is not significant (p = 0.20). The formula says its power for this effect was 0.394. What should the team say?

    Choose one answer.

  3. Question 31 of 65You get five p-values: 0.001, 0.012, 0.018, 0.030 and 0.45. Which result is correct at an overall level of 0.05?

    Choose one answer.

  4. Question 32 of 65A dashboard has 20 independent metrics and no real effects anywhere. Roughly what is the chance that at least one has p < 0.05?

    Choose one answer.

  5. Question 33 of 65In 1,000 simulated A/A tests (no true effect), a single test at the planned end gave a false-positive rate of 0.058. Stopping at the first of 10 looks with p < 0.05 gave 0.219. What explains the second number?

    Choose one answer.

ObjectiveDesign and sanity-check an A/B test of an ML system (unit of randomisation, sample ratio mismatch, novelty, interference, offline-online gaps) and say when a correlation can support a causal claim.

  1. Question 34 of 65Your 50/50 experiment has 50,500 users in control and 49,500 in treatment. The SRM chi-square is 10.0 (p = 0.0016). The treatment shows a significant gain. What should you do?

    Choose one answer.

  2. Question 35 of 65A team randomises 200 users per arm, each with 20 page views, but runs a page-view-level z-test as if all 8,000 views per arm were independent. In an A/A simulation, 21.4% of tests were significant at 5%. What is the cause and the fix?

    Choose one answer.

  3. Question 36 of 65Your new model improved the offline metric but an A/B test shows no lift. Which are plausible causes to check? Select all that apply.

    Choose all that apply.

  4. Question 37 of 65A hidden variable Z drives both X and Y, and X has no effect on Y. The observed correlation between X and Y is 0.502. When X is assigned at random instead, the correlation is -0.008. What does this show?

    Choose one answer.

ObjectiveCompare two models with a paired test or interval instead of two separate scores, say why cross-validation scores are not independent, and apply Bayes' rule to a base-rate or posterior question.

  1. Question 38 of 65Two models have accuracies 0.770 and 0.798 on the same 1,000 items. An unpaired two-proportion test gives p = 0.128, while McNemar's test on the disagreements (29 items only A right, 57 only B right) gives p = 0.0036. Why do they differ?

    Choose one answer.

  2. Question 39 of 65Ten random 90/10 train-test splits give ten paired score differences. A plain t-test gives t = 8.95. The Nadeau-Bengio corrected statistic is 6.16. What problem does the correction address?

    Choose one answer.

  3. Question 40 of 65A disease has 1% prevalence. A test has 90% sensitivity and a 10% false-positive rate. Someone tests positive. About what is the chance they are sick?

    Choose one answer.

  4. Question 41 of 65With a flat prior, variant A has 100 conversions in 1,000 and variant B has 120 in 1,000. The posterior probability that B beats A is 0.925, and the z-test p-value is 0.153. How do the two numbers relate?

    Choose one answer.

Data, features and production ML: preprocessing, encodings, point-in-time features, skew, drift and operations24 questions

ObjectiveTreat missing values by mechanism (MCAR, MAR, MNAR) with imputation and a missing indicator, handle outliers, scaling and skew, and fit every learned statistic on the training rows only.

  1. Question 42 of 65A variable has true mean 50.06 and about 35% of its values are missing. The mean of the observed values is 47.58. Filling each gap with the mean of its group, where the groups come from a fully observed column z, gives an overall mean of 50.00. Which explanation fits these numbers?

    Choose one answer.

  2. Question 43 of 65A lab value is missing for 70% of healthy patients and 20% of sick ones. The disease rate is 0.109 where the value is missing and 0.538 where it was measured. You will train a logistic regression. Which treatment keeps the most information?

    Choose one answer.

  3. Question 44 of 65Which statements about fitting preprocessing steps are correct? Select all that apply.

    Choose all that apply.

  4. Question 45 of 65A column has 99 ordinary values (mean 10, sd 2) and one value of 1,000. After standardising, the ordinary values have sd 0.020 instead of 1.000. What is the best response?

    Choose one answer.

ObjectiveChoose an encoding for a categorical feature (one-hot, ordinal, target, hashing, embedding), explain why target encoding leaks unless it is out-of-fold and smoothed, and say when a feature cross helps.

  1. Question 46 of 65A logistic regression needs a feature 'zip code' with 8,000 levels, many of them rare, and new zip codes appear every month. Which statement is correct?

    Choose one answer.

  2. Question 47 of 65Labels are independent of the category on purpose. A target-encoded feature scores AUC 0.770 on the training rows it was fitted on, 0.501 out-of-fold, and 0.489 on held-out rows. What does this show?

    Choose one answer.

  3. Question 48 of 65Target encoding with smoothing: the overall target mean is 0.40, and a level has 5 training rows of which 4 are positive. With smoothing strength m = 5, what is the encoded value?

    Choose one answer.

  4. Question 49 of 65Which statements about encoding are true? Select all that apply.

    Choose all that apply.

  5. Question 50 of 65In the script, the best single sign rule on x1 scores 0.500 accuracy, on x2 0.504, and on the product x1 times x2 scores 0.952. What is the right conclusion?

    Choose one answer.

ObjectiveBuild lag, rolling and aggregate features that use only information available at prediction time (point-in-time joins), and keep training and serving identical with one pipeline definition, logging and golden tests.

  1. Question 51 of 65A churn model uses the count of events in a window. Counting events in the 30 days before prediction time t gives AUC 0.773. Counting the 7 days after t as well gives AUC 0.921. What should you do?

    Choose one answer.

  2. Question 52 of 65Feature rows for one user are (time 2, low), (time 6, mid) and (time 7, high). A labelled event for that user happens at time 6.5. The join allows rows at most 1 time unit old (TTL 1). What value does the point-in-time join return?

    Choose one answer.

  3. Question 53 of 65A fraud rule flags values below 85. Offline, with missing values filled by the training median (100.0), precision is 0.831. Online, the same rule and model give precision 0.556 and many more flagged rows, because the serving code sends missing values as 0. What is the problem, and what is the fix?

    Choose one answer.

  4. Question 54 of 65Which statements about scikit-learn pipelines and encoders are true? Select all that apply.

    Choose all that apply.

  5. Question 55 of 65What does a feature store promise, and what does it cost?

    Choose one answer.

ObjectiveTell data drift, label shift and concept drift apart, compute PSI by hand and a KS statistic, say what each can and cannot see, and monitor a model whose labels arrive late.

  1. Question 56 of 65Expected bin shares are (0.4, 0.6) and actual shares are (0.3, 0.7). What is the PSI?

    Choose one answer.

  2. Question 57 of 65Two weeks of a model's input have PSI 0.0003 against training, yet accuracy on labelled cases fell from 1.000 to 0.659 because the true rule moved from 'x above 0' to 'x above 1'. What is this?

    Choose one answer.

  3. Question 58 of 65A daily PSI is computed on 100 rows against a 50,000-row reference with 10 bins and reads 0.12. With no drift, the simulation gave a mean PSI of 0.0950 and a 95th percentile of 0.2029 at this size. What do you do?

    Choose one answer.

  4. Question 59 of 65Which statements about detecting drift are true? Select all that apply.

    Choose all that apply.

  5. Question 60 of 65Labels arrive after a random delay with a mean of 20 days. A cohort aged 14 days shows an observed positive rate of 0.0253, while the true rate is 0.0496. A dashboard says the fraud rate halved in the last two weeks. What is the best reading?

    Choose one answer.

ObjectiveChoose retraining triggers and a safe rollout, version data, code and models so a result can be reproduced, and debug a model that works in the notebook but fails in production in a sensible order.

  1. Question 61 of 65In the toy drift simulation, never retraining scored mean accuracy 0.609 (0 retrains), retraining every 10 weeks 0.908 (3 retrains, worst week 0.673), and retraining when the last known accuracy fell below 0.95 gave 0.952 (15 retrains, worst week 0.854). Which statement is supported?

    Choose one answer.

  2. Question 62 of 65A model had AUC 0.91 offline and performs much worse in production. You can run one check first. Which one?

    Choose one answer.

  3. Question 63 of 65Which of these do you need to record to reproduce a trained model later? Select all that apply.

    Choose all that apply.

  4. Question 64 of 65A lender approves only applicants scoring above a cutoff and retrains every month on repayment outcomes of the approved loans. What is the main risk?

    Choose one answer.

  5. Question 65 of 65A new model scores live traffic and its predictions are logged, but nothing acts on them. What stage is this, and what does it catch that offline validation cannot?

    Choose one answer.

Boss challenge: Evaluation, statistics and data in practice

A longer check of the whole module. It is optional, and nothing else on the site depends on it.

  • 10 questions, taken from the lesson quizzes above.
  • Pass mark: 7 correct of 10.
  • You can try it as many times as you like.
  • A correct answer is kept, so a pass can build up across several tries.
  • If you miss some, you get links to the lesson sections to read again.

Checking answers needs JavaScript. You can still read every question and option below.

0 of 10 answered

Keyboard: arrow keys move between options. Space or Enter selects the focused option.

  1. Question 1 of 10Out of 10,000 transactions, 20 are fraud. Model C flags 30 and catches 12. Model D flags 100 and catches 19. A miss costs 1,000 and a false alarm 20. Which is true?

    Choose one answer.

  2. Question 2 of 10You forecast tomorrow's demand per store. Features include a 7-day rolling average of sales that ends on the row's own date, and the target is next-day sales. Which validation setup is most defensible?

    Choose one answer.

  3. Question 3 of 10A team has a 0.1% positive rate. They train with positives weighted by 999 and tune the threshold on validation data. The scores rank well, but the team plans to show the raw score as "chance of default" to customers. What should they do first?

    Choose one answer.

  4. Question 4 of 10You get five p-values: 0.001, 0.012, 0.018, 0.030 and 0.45. Which result is correct at an overall level of 0.05?

    Choose one answer.

  5. Question 5 of 10You draw 4,000 samples of size 5 from a right-skewed distribution with mean 1 and standard deviation 1. The standard deviation of the sample means is 0.453, close to the theoretical 0.447. Yet only 0.1% of the means fall below 1 - 1.96 x 0.447, while 4.4% fall above 1 + 1.96 x 0.447. What does this show?

    Choose one answer.

  6. Question 6 of 10Your 50/50 experiment has 50,500 users in control and 49,500 in treatment. The SRM chi-square is 10.0 (p = 0.0016). The treatment shows a significant gain. What should you do?

    Choose one answer.

  7. Question 7 of 10Labels are independent of the category on purpose. A target-encoded feature scores AUC 0.770 on the training rows it was fitted on, 0.501 out-of-fold, and 0.489 on held-out rows. What does this show?

    Choose one answer.

  8. Question 8 of 10A lab value is missing for 70% of healthy patients and 20% of sick ones. The disease rate is 0.109 where the value is missing and 0.538 where it was measured. You will train a logistic regression. Which treatment keeps the most information?

    Choose one answer.

  9. Question 9 of 10A churn model uses the count of events in a window. Counting events in the 30 days before prediction time t gives AUC 0.773. Counting the 7 days after t as well gives AUC 0.921. What should you do?

    Choose one answer.

  10. Question 10 of 10Labels arrive after a random delay with a mean of 20 days. A cohort aged 14 days shows an observed positive rate of 0.0253, while the true rate is 0.0496. A dashboard says the fraud rate halved in the last two weeks. What is the best reading?

    Choose one answer.