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

weights balancing for multilabels data #24

Closed
tanveer6715 opened this issue Nov 13, 2021 · 1 comment
Closed

weights balancing for multilabels data #24

tanveer6715 opened this issue Nov 13, 2021 · 1 comment

Comments

@tanveer6715
Copy link

Hi,
Good work. This code is for binary segmentation. If we have 4 or 5 classes in dataset then how can we calculate the weights of each class?

@yhlleo
Copy link
Owner

yhlleo commented Dec 11, 2021

Hi @tanveer6715 , thanks. The calculation for multiple classes is also similar:

Given [w_1, w_2, ..., w_k], where w_i refers to the percentage of the frequency of class i, we can have the median w_med = median([w_1, w_2, ..., w_k]), then the can balance the weights in this manner: w'_i = w_med/w_i.

@yhlleo yhlleo closed this as completed Dec 12, 2021
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