Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better interface to weight vector? #3

Open
nschneid opened this issue Mar 16, 2013 · 0 comments
Open

better interface to weight vector? #3

nschneid opened this issue Mar 16, 2013 · 0 comments

Comments

@nschneid
Copy link
Collaborator

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant