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

Subproblem negative class weight is always set to 1 in OVR classification #64

Open
vbogach opened this issue Jun 16, 2020 · 1 comment

Comments

@vbogach
Copy link

vbogach commented Jun 16, 2020

It's possible to set both negative and positive class weights in a binary classification scenario. However, when a multi-class classification model is trained using a OVR solver, it's possible to set weight only for the positive (i.e. One) class, but the weight for the negative (i.e. Rest) class is always set to 1.

The difference can be seen in https://github.com/cjlin1/liblinear/blob/master/linear.cpp#L2552 where train_one uses both weights and https://github.com/cjlin1/liblinear/blob/master/linear.cpp#L2578 where param->C is used. That corresponds to always using 1 as a weight.

That doesn't allow class weight normalization, and unnormalized weights bias the C term.

@cjlin1
Copy link
Owner

cjlin1 commented Jun 16, 2020 via email

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

No branches or pull requests

2 participants