Export to GitHub

pmtk3 - issue #37

options.weights not working with cvglmnetMulticlass()


Posted on Jan 30, 2012 by Helpful Rabbit

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;

Comment #1

Posted on Jan 4, 2014 by Happy Camel

Moved to GitHub: https://github.com/probml/pmtk3/issues/37

Status: New

Labels:
Type-Defect Priority-Medium