3
$\begingroup$

I am trying to fit a lasso penalized logistic regression model to a certain data. I am using lassoglm for that in matlab. I use the following function

[B,FitInfo] = lassoglm(X,Y,'binomial','Lambda',0.01,'CV',10);

Using 10 fold cross validation, it will use different samples every time to fit the model. However, I didn't get what deviance means in this case. Lets say for the first run of cross validation, I have k non zero features. For next run, I have a model with m non zero features and so on. What does deviance then measure and how the plot is generated like using that lassoplot. Suggestion?

Actually, I didn't get this figure. What does it specify? enter image description here

$\endgroup$
2
$\begingroup$

According to MATLAB's help, deviance is the value of the loss function for the type of model that you are using. It is the value of negative log-likelihood (MSE for linear regression) for your model averaged over the validation folds in the cross-validation procedure.

According to MATLAB's help, the two points marked in the graph are:

Plots the value of Lambda with minimum cross-validated MSE.

Plots the greatest Lambda that is within one standard error of minimum MSE (so makes the sparsest model within that region).

$\endgroup$
3
  • $\begingroup$ And what are the bars for. I mean for each point there is a bar. What is that for? $\endgroup$ – rajan sthapit Feb 10 '13 at 5:04
  • $\begingroup$ MATLAB's help says: "Plots error bars for the estimates." To me they look like 1-standard deviation confidence intervals. You can see that for large values of lambda --which produces sparse models-- the variation is smaller, which confirms my guess. $\endgroup$ – Taha Feb 10 '13 at 6:42
  • $\begingroup$ The bars are the standard deviation of the deviance, computed across the ten cross validation folds. $\endgroup$ – Matthew Drury Mar 12 '17 at 17:09
0
$\begingroup$

The green circle and dashed line locate the Lambda with minimal cross-validation error.

The blue circle and dashed line locate the point with minimal cross-validation error plus one standard deviation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.