-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Right now the weight vector is always a vector<double>, and for discrete regression (ordinal regression and multiclass logistic regression) the vector subscript is computed inline.
Suggested interface for the discrete weight vector: an "enhanced" vector in which the () operator is overloaded to take the class (label index) and the feature id as separate arguments. (Can this be done by subclassing or wrapping vector and still play nicely with optimization routines?) So weights(k, fid) would access the weight for a given class-feature pair, and weights(k, fid, w) would assign the value w to that weight. This should make working with the weights vector more intuitive.
An additional benefit would be that the weights instance can store extra information, e.g. whether or not one of the K classes should be treated as a background class (which affects indexing into the vector).