Database Reference
In-Depth Information
Metrics for varying values of step size
L2 regularization
In Chapter 5 , Building a Classification Model with Spark , we saw that regularization has
the effect of penalizing model complexity in the form of an additional loss term that is a
function of the model weight vector. L2 regularization penalizes the L2-norm of the
weight vector, while L1 regularization penalizes the L1-norm.
We expect training set performance to deteriorate with increasing regularization, as the
model cannot fit the dataset well. However, we would also expect some amount of regu-
larization that will result in optimal generalization performance as evidenced by the best
performance on the test set.
We will evaluate the impact of different levels of L2 regularization in this code:
params = [0.0, 0.01, 0.1, 1.0, 5.0, 10.0, 20.0]
metrics = [evaluate(train_data, test_data, 10, 0.1, param ,
Search WWH ::




Custom Search