Ravindra BagaleCourses & study guides मराठी Track your progress

38. Overfitting and Underfitting in Machine Learning

38.3 Simple Fixes

Why. Once you name the problem, apply simple fixes before fancy theory.

What. Common fixes: more clean rows; fewer / better features; simpler model (shallower tree, fewer forest trees to start); regularisation options later; always keep a true holdout test set.

How.

Fix menu for beginners

  1. Overfit? Reduce tree depth; add data; drop leaky or noisy columns.
  2. Underfit? Add useful features; allow a slightly richer model; check you did not delete the signal.
  3. Always: evaluate on test rows you never trained on.
# Same API, simpler hypothesis
safer_tree = DecisionTreeClassifier(max_depth=3, min_samples_leaf=2, random_state=0)

Ravindra Bagale's Tip

Pehle simple model + clean split. Complexity baad me.