What steps will reproduce the problem?
1. Set a weight vector in glmnetSet() produced options struct
2. Run cvglmnetMulticlass() with above options
What is the expected output? What do you see instead?
Should train a glmnet model. Instead, error occurs in cvglmnetMulticlass() line
60 because the weight vector inside the CV loop has a different size w.r.t
target vector y.
What version / revision of the product are you using? On what operating
system?
pmtk3-3jan11/pmtk3-2april2011, Win7 64bit
Please provide any additional information below.
Proposed MATLAB code to replace lines 57-62 in cvglmnetMulticlass.m:
weights = options.weights;
for i=1:nfolds
which=foldid==i;
if verbose, disp(['Fitting fold # ' num2str(i) ' of ' num2str(nfolds)]);end
options.weights = weights(~which);
cvfit = glmnet(x(~which,:), y(~which),family, options);
predmat(which,:) = glmnetPredict(cvfit, type,x(which,:),options.lambda);
end
options.weights = weights;
Original issue reported on code.google.com by Tapio3...@gmail.com on 30 Jan 2012 at 2:43
Original issue reported on code.google.com by
Tapio3...@gmail.com
on 30 Jan 2012 at 2:43