

- Base loss: measures prediction error (e.g., MSE, cross-entropy).
- Regularized loss: base loss + penalty term that grows with model complexity.
- Strength: controlled by a hyperparameter (commonly λ or
alpha) that scales the penalty.


- Dropout (deep learning): randomly disables a subset of neurons during each training step, preventing co-adaptation and reducing overfitting.

- Early stopping: track validation loss or metrics and stop training when improvement stalls to prevent overfitting from excessive epochs.
- Data augmentation (images): artificially expand training data with random transforms — flips, rotations, crops, brightness/gamma changes — to improve model robustness.
- Linear Learner supports both L1 and L2:
- L1: absolute weight penalty, useful for sparsity and feature selection.
- L2: squared weight penalty, shrinks coefficients to reduce variance.

Example: XGBoost estimator in SageMaker
weight_decay: commonly used for L2 regularization.num_layers: increasing layers raises capacity and overfitting risk.mini_batch_size: affects gradient estimates and training stability.epochs: more epochs increase risk of overfitting (use early stopping).learning_rate: impacts optimization dynamics; lower rates can act like a regularizer.
weight_decayimplements L2 regularization.learning_ratecontrols the optimizer behavior (not a regularization parameter, but relevant to convergence).
- Use automated hyperparameter tuning (AWS SageMaker Automatic Model Tuning or other HPO frameworks) to search for optimal values of
alpha,lambda,weight_decay, dropout rate, etc. - Start with reasonable defaults and sweep logarithmically (e.g.,
1e-4to1e0) for penalty strengths.
When supplying XGBoost hyperparameters in a Python dict, use string keys for parameters like
"lambda" because lambda is a reserved keyword in Python. For example: {"lambda": 1.0}.- Scikit-learn documentation
- XGBoost documentation
- ResNet paper (He et al.)
- AWS SageMaker resources and tutorials: SageMaker documentation