38
votes
Accepted
Why does adding a dropout layer improve deep/machine learning performance, given that dropout suppresses some neurons from the model?
The function of dropout is to increase the robustness of the model and also to remove any simple dependencies between the neurons.
Neurons are only removed for a single pass forward and backward ...
29
votes
Accepted
L1 & L2 Regularization in Light GBM
First, note that in logistic regression, using both an L1 and an L2 penalty is common enough to have its own name: ElasticNet. (Perhaps see https://stats.stackexchange.com/q/184029/232706 .) So ...
25
votes
Accepted
When should one use L1, L2 regularization instead of dropout layer, given that both serve same purpose of reducing overfitting?
I am unsure there will be a formal way to show which is best in which situations - simply trying out different combinations is likely best!
It is worth noting that Dropout actually does a little bit ...
12
votes
Accepted
Dropout vs weight decay
These techniques are not mutually exclusive; combining dropout with weight decay has become pretty standard for deep learning.
However, where weight decay applies a linear penalty, dropout can cause ...
12
votes
Accepted
Regularization in simple math explained
The function you have described is a loss function. It is the function which we want to minimize in order to train our model. The loss function is called ordinary least squares. We can also see that ...
10
votes
Accepted
difference in l1 and l2 regularization
That is generally not true, to be more accurate we can say that L1 promotes sparsity. if a weight is larger than 1 then L2 cares more about it than L1 while if a weight is less than 1 then L1 cares ...
9
votes
Accepted
Why using L1 regularization over L2?
Basically, we add a regularization term in order to prevent the coefficients to fit so perfectly to overfit.
The difference between L1 and L2 is L1 is the sum of weights and L2 is just the sum of the ...
8
votes
Regularization practice with ANNs
activity_regularizer are used to control the output of a neural network. They tend to make the output smaller. Suppose the loss function is give as :
...
7
votes
Why does dropout ruin my accuracy in CNN?
As your network is working without dropout, I think your problem is about how many epoches you run.
In your code, it seems that only one epoch will be run. With dropout enabled, each neuron has 50% ...
7
votes
Understanding XG Boost Training (Multi class classification)
What can I understand/interpret from the training & test loss graph?
This checking out the quality of the model. If the train and test set loss decreasing according to the number of epoch in the ...
6
votes
Accepted
What's the best way to tune the regularization parameter in neural nets
Wikipedia lists some well-known approaches to hyper-parameter searches.
The brute-force scan/search, or a grid search across multiple parameters, is still a very common and workable approach. As is ...
6
votes
Accepted
Can ridge regression be used for feature selection?
Unlike lasso, ridge does not have zeroing coefficients as a goal, and you shouldn't expect applying ridge penalty to have this effect. So the answer to your title question is "no."
However, in your ...
6
votes
On simple 1D dataset, LogisticRegressionCV selects terrible hyperparameters, resulting scores are nonsensical
First I did a visualization of what your code is doing (see code at the bottom)
The model seems completely fine. The coefficient of the linear regression is close to 0, where it should be given how ...
6
votes
Should you turn off label smoothing when validating?
The way most people gain an initial understanding of label smoothing (and what most common explanations have to say on the subject) plays a great role in how one would approach this question.
At first ...
6
votes
How to handle Overfitting
This is a very general question, however, there are many different solutions as explained below. For your case, probably, item 2 is not the case because you can not gather a large number of data ...
5
votes
Using L1 penalty in XGBoost
L2 and L1 regularization are controlled via the lambda (=reg_lambda) and alpha (=reg_alpha) parameter respectively. Higher ...
5
votes
When should one use L1, L2 regularization instead of dropout layer, given that both serve same purpose of reducing overfitting?
It seems deciding between L2 and Dropout is a "guess and check" type of thing, unfortunately. Both are used to make the network more "robust" and reduce overfitting by preventing ...
5
votes
Accepted
Light GBM Regressor, L1 & L2 Regularization and Feature Importances
With regularization, LightGBM "shrinks" features which are not "helpful". So it is in fact normal, that feature importance is quite different with/without ...
5
votes
L1 & L2 Regularization in Light GBM
In this medium post, you can find a concise and very clear explanation regarding these parameters https://medium.com/@gabrieltseng/gradient-boosting-and-xgboost-c306c1bcfaf5
Gabriel Tseng, Author of ...
5
votes
Why use regularization instead of decreasing the model
Regularization does decrease the capacity of the model in some sense, but as you already guessed, different capacity reductions result in models of different quality and are not interchangeable.
L1 ...
5
votes
Understanding XG Boost Training (Multi class classification)
Assuming your x axis is nrounds(Or ntrees) parameter,
XGB is an ensemble of many many trees built on top of one another. Your XAxis indicates how many trees have been used. Consider 2 points at x = ...
5
votes
Accepted
When I add regularization like L1,L2 , do I need more epochs to properly train my model?
The convergence time is sensitive to the data you have and a random seed. Specifically, the convergence time is linear in expectation in all three cases. ...
5
votes
Accepted
Visualizing effect of regularization for linear regression problem
Your understanding of regularization is completely correct, it just seems that the value for alpha you are using is too low for this example to have any meaningful impact. Increasing the value for ...
5
votes
How can I implement some data constraints on a neural network?
You can impose monotonicity constrains in Tensorflow/Keras models with library Tensorflow-Lattice.
I suggest you have a look at their Shape Constraints to understand how to apply it to your case, ...
4
votes
Accepted
Is LASSO regression implemented in Statsmodels?
The question-asker resorted to scikit-learn until now, but statsmodels has just come out with its implementation of Lasso regression. The docs here are pretty self-explanatory and concise.
4
votes
Accepted
Which regularizer to use to get a sparse set of regression parameters?
The most common sparse regularizer is sum of absolute values (so-called Lasso regression). With carefully chosen penalty coefficient, it makes some of less useful parameters exactly zero.
Cardinality ...
4
votes
Why does adding a dropout layer improve deep/machine learning performance, given that dropout suppresses some neurons from the model?
Another way of looking at what dropout does is that it is like a slab-and-spike prior for the coefficient for a covariate (that is some complex interaction term of the original covariates with some ...
4
votes
Why does Lasso behave "erratically" when the number of features is greater than the number of training instances?
When p > n, the LASSO model can only sustain up to n variables (this can be proven using linear algebra, the rank of the data matrix in particular), leaving at least p - n variables out (some that ...
4
votes
Light GBM Regressor, L1 & L2 Regularization and Feature Importances
Here's a link to a good answer for the follow up question of "should you use both L1 and L2 regularization terms?" Summarized briefly here:
These lightGBM L1 and L2 regularization ...
4
votes
If my model is overfitting the training dataset, does adding noise to training dataset help regularizing the machine learning model
No, adding noise will not help to regularise the model.
This won't help your model generalise better to unseen inputs. It will probably just make your model perform generally worse. Any modifications ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
regularization × 168machine-learning × 55
neural-network × 41
deep-learning × 25
overfitting × 23
linear-regression × 18
regression × 13
keras × 12
logistic-regression × 12
dropout × 12
lasso × 12
scikit-learn × 11
cnn × 10
xgboost × 10
svm × 8
python × 7
loss-function × 6
ridge-regression × 6
classification × 5
r × 5
feature-selection × 5
tensorflow × 4
statistics × 4
random-forest × 4
convolutional-neural-network × 4