# 7 Report: L1 (Lasso) Regularization
# 7 Report: L1 (Lasso) Regularization
# 7 Report: L1 (Lasso) Regularization
L1 (Lasso) Regularization:
This is the function for the cost function using the Lasso
Regularization(L1 Regularization).
L2 (Ridge) Regularization:
This is the function for the cost function using the Ridge
Regularization(L2 Regularization).
Part 3:
In case of L2 regularization,
● If ƛ = 0, the solution is same as in regular least-squares
linear regression
● If ƛ → ∞ , the solution w → 0
● Positive ƛ will cause the magnitude of the weights to be
smaller than in the usual linear regression.
In case of L1 regularization,
ƛ might help in reducing some of the unnecessary weights to 0,
instead of a finite value, which is not the case in L2
regularization. L2 regularization does not lead to weights
becoming 0, unless ƛ → ∞.
Part 4:
In the case of ML, both ridge regression and Lasso find their
respective advantages. Ridge regression does not completely
eliminate (bring to zero) the coefficients in the model whereas
lasso does this along with automatic variable selection for the
model. This is where it gains the upper hand. While this is
preferable, it should be noted that the assumptions considered
in linear regression might differ sometimes.
Both these techniques tackle overfitting, which is generally
present in a realistic statistical model. It all depends on the
computing power and data available to perform these
techniques on a statistical software. Ridge regression is faster
compared to lasso but then again lasso has the advantage of
completely reducing unnecessary parameters in the model.
Part 5:
Cross-validation is a resampling procedure used to evaluate
machine learning models on a limited data sample.
The procedure has a single parameter called k that refers to the
number of groups that a given data sample is to be split into. As
such, the procedure is often called k-fold cross-validation.
When a specific value for k is chosen, it may be used in place
of k in the reference to the model, such as k=5 becoming 5-fold
cross-validation.
Cross-validation is primarily used in applied machine learning
to estimate the skill of a machine learning model on unseen
data. That is, to use a limited sample in order to estimate how
the model is expected to perform in general when used to make
predictions on data not used during the training of the model.
It is a popular method because it is simple to understand and
because it generally results in a less biased or less optimistic
estimate of the model skill than other methods, such as a
simple train/test split.