Lesson 9 of 10 · 2 min
Common Errors & Fixes
| Error | Cause | Fix |
|---|---|---|
ValueError: Target is multiclass in roc_auc_score | Default binary mode | Add multi_class='ovr' |
| High accuracy but poor recall | Imbalanced classes | Use F1, precision, recall instead |
ConvergenceWarning | Too few iterations | Add max_iter=500 or max_iter=1000 |
| Test AUC much lower than train | Overfitting | Add regularisation: C=0.1 (smaller C = more regularisation) |
predict_proba shape confusion | Forgot column index | [:, 1] for binary, use all columns for multiclass |
Wrong average in multiclass metrics | Default is binary | Use average='macro' (equal weight per class) or 'weighted' (weight by support) |
