Python exercise · about 5 minutes · free
Always Start with a Baseline
A model that always says 'no default' is 91% accurate here, and completely useless. Baselines keep you honest.
DummyClassifier(strategy="most_frequent") always predicts the most common class. If your real model can't clearly beat it, it isn't learning anything useful. Also check recall: how many real defaults did it catch?
Your quest: Fit the dummy model, then set
acc (accuracy) and rec (recall for defaults).Try it now Runs in your browser. No sign-in needed. Ctrl+Enter to run.
Hint
m = DummyClassifier(strategy="most_frequent").fit(X, y); p = m.predict(X); acc = accuracy_score(y, p); rec = recall_score(y, p)Output appears here.