Skip to content
C

Problem 4: Diagnose a Model Given Only Its Scores

Easypython

Problem Description

Write a Python program that takes a training score and test score as input, and prints whether the model is likely overfitting, underfitting, or well-balanced, based on simple rule-based logic (e.g., large gap = overfitting; both low = underfitting).

Input

A training score and a test score (e.g., accuracy or R²).

Output

A diagnosis: "Overfitting", "Underfitting", or "Well-balanced".

Constraints

  • Scores are between 0 and 1.

Example Input

text
train_score=0.98, test_score=0.65

Example Output

text
Diagnosis: Overfitting

Concepts Covered

Conditional logic, threshold-based diagnosis.

Input (stdin)

Output

Run your code to see output here...