All problems

Diagnosing Overfitting From the Gap

easyPythonModel Validation

Halewood Analytics screens every model before it goes live. Each model arrives with two accuracy figures. One is measured on the examples the model was trained on. The other is measured on a held-out set: rows deliberately kept back, which the model has never seen. A model that has merely memorised its training rows looks brilliant on the first figure and much weaker on the second. The screening desk wants that difference turned into a one-word verdict.

Task: Print whether the model has memorised its training rows or is holding up on unseen ones.

Input

One line holding two numbers separated by a single space: the accuracy on the training rows, then the accuracy on the held-out rows. Both lie between 0 and 1.

Output

One line. Print overfitting when the training accuracy is ahead of the held-out accuracy by strictly more than 0.1, and generalizing well otherwise. A lead of exactly 0.1 is not enough to flag. A model that scores better on the held-out rows is never flagged.

Example:

Input:
0.95 0.80

Output:
overfitting

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…