Eighty observations and six correlated predictors, of which only x1 and x2 have any real effect — the true coefficients of x3 through x6 are exactly zero. Move the mixing dial and watch what changes and what does not. At a full lasso share the fit keeps three predictors and resampling returns sixteen distinct sets; at a share of 0.2 it keeps five and returns ten. The noise variables x3, x5 and x6 survive 18–25% of resamples under pure lasso and 82–88% under mostly-ridge. The cross-validated error across that entire range is 7.1547, 7.1555 and 7.2207.
4 of 6 predictors kept, at a cross-validated error of 7.1555
Pure lasso keeps 3 at an error of 7.1547; pure ridge keeps 6 at 7.2249. The dial moves the length of the list and barely moves the accuracy, so it is choosing between two accounts of the same data rather than between a better and a worse model. The stability column below is where the real difference shows up.
Predictors kept
4 of 6
at a lasso share of 0.5
Cross-validated error
7.1555
least squares: 7.3486
Distinct sets on resampling
14
across 60 resamples
Mean per-predictor stability
73.3%
higher means less arbitrary
The same data along the whole dial
Predictors kept, error and selection stability at each mixing share
Lasso share
Predictors kept
Cross-validated error
Distinct sets
Mean stability
1
3 of 6
7.15469
16
55.0%
0.5
4 of 6
7.15547
14
73.3%
0
6 of 6
7.22495
1
100.0%
The error column is the one that barely moves. Everything else does. A reader given only the final model would have no way to know that a different mixing share — equally defensible, equally accurate — would have produced a different list of predictors.
Every predictor at this setting
Coefficient and resampling stability for each predictor, with the pure-lasso comparison
Predictor
Coefficient
In the set
Survives in
Under pure lasso
x1
1.3225
kept
100.0%
100.0%
x2
0.5758
kept
95.0%
90.0%
x3
0
dropped
41.7%
18.3%
x4
0.5532
kept
91.7%
75.0%
x5
0.0021
kept
56.7%
21.7%
x6
0
dropped
55.0%
25.0%
Lowering the lasso share raises stability by keeping correlated predictors together instead of picking one of them. That is a genuine improvement in reproducibility and it is not the same as finding the right answer — a longer list is more stable partly because it is less selective.
At a lasso share of zero this is exactly ridge regression, and the suite confirms the coordinate-descent fit here agrees with the closed-form ridge solution to within 1e-8 at four different penalties. At a share of one it is exactly lasso. The dial is continuous between two methods rather than a third method of its own.
Tuning the mixing share by cross-validation alongside the penalty is common and worth doing carefully: the error surface is flat enough that the chosen share is close to arbitrary, and the same instability that affects the penalty affects it more.
The whole dial Stability per predictor Penalty cross-validated Both extremes computed Error shown to be flat
What this tool shows
At a full lasso share the fit keeps three predictors and resampling returns sixteen distinct sets. At a share of 0.2 it keeps five and returns ten. The cross-validated error across that entire range is 7.1547, 7.1555 and 7.2207. The mixing parameter is usually presented as a modelling choice with a right answer. On correlated predictors it is a dial between two accounts of the same data, and the accuracy barely notices. The noise variables x3, x5 and x6 — true coefficients of exactly zero — survive 18 to 25% of resamples under pure lasso and 82 to 88% under mostly-ridge.
The fit at any mixing share from pure lasso to pure ridge
Both extremes computed on every run, so the dial is visible rather than implied
Selection stability per predictor at the chosen share and under pure lasso
Cross-validated error along the dial, which turns out to be nearly flat
How many distinct predictor sets resampling produces at each end
The exact reduction to ridge at a share of zero
The whole dial Stability per predictor Penalty cross-validated Both extremes computed
The mixing share changes what you report, not how well you predict.
Updated 13 September 2026 · Works in any browser, no installation
Elastic net penalises both the absolute size of the coefficients and their squared size, with a mixing parameter setting how much of each. The absolute part is what creates exact zeros and produces a short list; the squared part is what keeps correlated predictors together rather than picking one of them arbitrarily. At a mixing share of one it is lasso, at zero it is ridge, and everywhere in between it trades list length against how reproducible that list is.
At a glance
Formula shown
Elastic net minimises ‖y − Xβ‖²/2n + λ(α‖β‖₁ + (1−α)‖β‖²/2), where α is the lasso share. At α = 1 the penalty is purely absolute and coefficients reach exactly zero; at α = 0 it is purely squared and none does. Fitted by coordinate descent with soft thresholding, which at α = 0 reproduces the closed-form ridge solution.
Scenario support
Groups of correlated predictors where lasso would keep one arbitrarily, wide datasets with more predictors than observations, any model where a shorter list is wanted but arbitrary selection is not acceptable, and settings where the same analysis will be repeated on new data.
Educational estimate
Planning support from the values you enter — not professional advice.
Same error, different story
The preset has six correlated predictors of which two are real. x1 and x2 have true coefficients of 1.2; x3 through x6 have true coefficients of exactly zero.
At a full lasso share, the fit keeps three predictors. Resample the rows sixty times and sixteen distinct sets come back. The noise variables survive 18.3%, 21.7% and 25.0% of the time.
At a share of 0.2, the fit keeps five. Resampling now returns ten distinct sets, and those same noise variables survive 82%, 85% and 88% of the time — consistently, rather than at random.
The cross-validated error is 7.1547 at a share of one, 7.1555 at a half, and 7.2207 at 0.2. Three models with different lengths, different stories about which predictors matter, and effectively identical accuracy.
That is the thing to take from this page. The mixing share is not choosing between a better and a worse model. It is choosing between “three predictors matter” and “five predictors matter”, on data that cannot distinguish the two — and a reader given only the final model has no way to see that another equally defensible setting would have produced a different list.
What the ridge part actually buys
The standard argument for elastic net is the grouping effect: where lasso picks one predictor from a correlated cluster and zeroes the rest, elastic net keeps them together with shared coefficients. The stability table shows that happening.
It is a real improvement in reproducibility. A list that comes back the same way across resamples is worth more than one that does not, and lowering the lasso share raises mean per-predictor stability substantially on this data.
It is worth being clear about why, though. The longer list is more stable partly because it is less selective: keeping five of six predictors is a decision that has less room to vary than keeping three. Some of the stability gain is genuine grouping, and some is simply the shorter distance between “keep five” and “keep everything”.
The honest summary is that elastic net gives a more reproducible list, not a more correct one. On the preset it raises the survival rate of three pure noise variables from about a fifth to about six sevenths. Those variables have no effect at all, and the more stable method keeps them consistently.
Tuning two parameters instead of one
Elastic net has two things to choose: the penalty and the mixing share. The usual approach is a two-dimensional cross-validation over both, and it inherits all the instability of the one-dimensional version, amplified.
The error surface along the mixing dial is flat — 7.1547 to 7.2207 across the whole range on this data — which means cross-validation has very little to go on when choosing it. A quantity selected off a flat surface is close to arbitrary, and the chosen share will move when the folds are re-drawn much as the penalty does, only more.
The practical consequence is that the mixing share is better set by what you want from the model than by cross-validation. If the output is a list someone will act on, a lower lasso share gives a more reproducible one. If the output is a compact prediction formula, a higher share gives a shorter one. Cross-validation will not resolve that for you, because from its point of view the choices are equivalent.
The two ends of the dial
At a mixing share of zero this is exactly ridge regression. Not approximately — the coordinate-descent routine used here agrees with the closed-form ridge solution to within 1e-8 at four different penalties, which is a real cross-check since the two arrive by entirely different computational routes.
At a share of one it is exactly lasso. So elastic net is not a third method; it is a continuous path between two, and both endpoints are computed on every run so the position on that path is visible rather than implied.
The behaviour at the ends is what the penalties dictate. Ridge keeps every predictor because its penalty is smooth at the origin and offers no corner for a coefficient to settle into. Lasso produces zeros because its penalty has one. Mixing them gives a corner that is less sharp, so fewer coefficients reach it.
Reporting it
Report the mixing share with the same prominence as the penalty. A reader who knows only that an elastic net was fitted does not know whether the list in front of them is a lasso-style shortlist or a ridge-style everything, and those support very different claims.
Report the error at more than one share if you have it. On flat surfaces like this preset, showing that the accuracy was unchanged across the dial is more informative than showing the chosen point, because it tells a reader how much the list depended on a choice rather than on the data.
Give per-predictor stability rather than a bare list, for the same reason it matters on the lasso page: the list is the unstable part of the output, and one extra column makes that visible instead of hiding it.
Sources and methodology
References for the mixed penalty and its computation.
Method. The mixed penalty is fitted by cyclic coordinate descent with soft thresholding on standardised predictors, with both the absolute and squared components scaled by n so a given penalty means the same thing across this family of pages. The suite confirms the endpoints exactly: at a lasso share of zero the fit reproduces the closed-form ridge solution to within 1e-8 at four penalties, and pure ridge keeps every predictor while pure lasso keeps no more than a mixed fit does, which keeps no more than pure ridge. Selection stability comes from sixty deterministic bootstrap resamples refitted at the chosen penalty. That engine is verified on every change against 395 assertions. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
Lasso RegressionFit a lasso across a penalty path with cross-validation, and see how often each selected predictor survives when the rows are resampled.
Ridge RegressionFit ridge regression across a penalty path chosen by cross-validation, with least squares beside it and the shrinkage applied to every coefficient shown.
Cross-ValidationRun k-fold cross-validation over a penalty path and repeat it across twelve fold assignments, so the variability of the chosen tuning parameter is visible.
Principal Component RegressionRegress on principal components with each component's variance share printed beside its correlation with the outcome, and the error at every component count.
Multiple RegressionFits several predictors with a VIF on every term, and names the configuration people misread: a model significant at p = 0.0103 where neither predictor reaches 0.05, at a VIF of only 7.11.
VIFVariance inflation factors with Belsley-Kuh-Welsch condition indices and variance-decomposition proportions, so a near-dependency is named rather than only detected.
An educational tool. Selection under any penalised method is unstable and should not be reported as a finding about which variables matter; elastic net improves reproducibility partly by keeping more predictors rather than by identifying the right ones. The error surface along the mixing dial is frequently flat, making a cross-validated choice of that parameter close to arbitrary.