Implement Logistic Regression with L2 Regularization from scratch in Python
Regularization is a technique to solve the problem of overfitting in a machine learning algorithm by penalizing the cost function. It does so by using an additional penalty term in the cost function. So, how can L2 Regularization help to prevent overfitting? Let's first look at our new cost function: It controls the trade-off between two goals: fitting the training data well vs keeping the params small to avoid overfitting. The regularization term will heavily penalize large wᵢ.
Jul-27-2020, 04:11:04 GMT