Overfitting and Regularization


Overfitting

Pasted image 20240715161729.png

How to Fix:

  1. Adding More Data:
    • Retrain the algorithm on a larger, more diverse dataset to improve model performance.
    • Consider data augmentation to artificially increase the size of the dataset, introducing new variations to improve generalization.
  2. Regularization:
    • Introduce a complexity penalty to the model to prioritize simpler solutions and reduce overfitting.
    • Various regularization techniques exist to prevent overfitting by restricting the model's complexity.
  3. Removing Features:
    • Simplify the data by removing irrelevant or complex features to reduce overfitting.

Regularization

Ridge Regression / L2 Regularization

βridge=(XTX+λI)1XTy

Where:

Lasso Regression / L1 Regularization

β^=argminβ{12ni=1n(yij=1pxijβj)2+λj=1p|βj|}

J(β)=12ni=1n(yij=1pxijβj)2+λj=1p|βj|

12ni=1n(yij=1pxijβj)2

λj=1p|βj|

J(β)=12ni=1n(yij=1pxijβj)2+λj=1p|βj|

β^=argminβJ(β)


View Next Topics

Linear Regression Model