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

Add weight parameter for training C-SVC SVMs on unbalanced data #18

Open
dbogdanov opened this issue Apr 24, 2015 · 2 comments
Open

Add weight parameter for training C-SVC SVMs on unbalanced data #18

dbogdanov opened this issue Apr 24, 2015 · 2 comments
Assignees

Comments

@dbogdanov
Copy link
Member

Libsvm supports working with unbalanced data via adding class weights. Add a new parameter for SVM configuration which will allow to configure weights for each class. Currently the weights are unassigned by default, and there is not way to configure them.

Make sure that cross-validation is not affected by unbalanced data as well.

@palonso
Copy link
Contributor

palonso commented Apr 15, 2019

Implemented in 3c2ca55 (PR #86)

However when you say,

Make sure cross-validation is not affected by unbalanced data

the expected behavior is not clear for me. My intuition was to compute the weights for each fold and not globally for whole the dataset as this way the SVM input will always be balanced. Do you agree?

@dbogdanov
Copy link
Member Author

That is correct. However, we can also consider doing stratified splits (e.g., see sklearn) as curently we just randomly split all the data disregarding the distribution of labels. What do you think?

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

2 participants