MATLAB Answers


How does Cross Validation work in Matlab

Asked by Benjamin on 13 Mar 2019
I am doing some research on Lasso classification method. I have a 40x15 dataset and I want to develop a binomial equation without dividing data into train and test set (because of small sample size). But I need to know some fundamental concepts:
I really need to know when I hit the Run bottom on Matlab (B=lassoglm(X,Y,'CV',10)) what would be the steps that it does in breakdown steps?
I specifically need to know when I put e.g. CV=10, does Matlab take 10 points from my sample size? and then from that 10 points, it tries to make the insignificant coefficients to zero by imposing a penalty?
Does Matlab perform various runs and choose various 10 points for each Lambda? If so, is the error bar in the Cross-Validated Deviance of Lasso Fit plot because of these various runs? and then if that is true, is each column of B matrix an average of those analyses?


Sign in to comment.

0 Answers