anujkhare / iregnet

7 stars 12 forks source link

weights parameter #55

Open tdhock opened 7 years ago

tdhock commented 7 years ago

Hey @anujkhare how hard would it be to modify the C++ code to use weights w_i > 0 specific to each observation/row i? The weights would affect the loss/likelihood function. Right now the objective function is

min_f sum_i loss(y_i, f(x_i)) + Penalty(f) 

but with weights it would become

min_f sum_i w_i loss(y_i, f(x_i)) + Penalty(f)

I don't know of any data sets where this is absolutely essential for iregnet, but it is typically useful in glmnet for logistic regression models (binary classification problems) where there are a lot more of one class than another. For now I don't think we should worry about implementing this, but I was just wondering if you had thought about it.