sgd icon indicating copy to clipboard operation
sgd copied to clipboard

No support for weights

Open jeffwong-nflx opened this issue 8 years ago • 2 comments

Hi, it would be great to have support for a weights vector as in glmnet

jeffwong-nflx avatar Nov 24 '16 01:11 jeffwong-nflx

Hello,

I met the same limitation when trying to use this package to fit a "glm" model.

More precisely, I need to optimize a loss function where each term is multiplied by a constant scalar given by the user. This corresponds to the argument "weights" of the glm function (stats package).

If the package is still maintained, it would be very usefull to add this feature and I suppose this is not very costly in term of code. However, it seemed to me this part of the code is written in C++, which I don't know how to deal with.

ChrisBotella avatar Dec 14 '17 16:12 ChrisBotella

As a workaround, I suppose you can just multiple both your covariate matrix x and y by sqrt(weights) ?

tomwenseleers avatar Mar 06 '23 14:03 tomwenseleers