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

balance_index: (int) balance class index, should be specific when alpha is float #9

Open
DeeDiveT opened this issue Aug 15, 2019 · 4 comments

Comments

@DeeDiveT
Copy link

Hi @Hsuxu ,

I'm a little bit confused about balance_index.

What happens to the loss when alpha is of type float?

Millions of thanks in advance.

@Hsuxu
Copy link
Owner

Hsuxu commented Aug 17, 2019

It only apply alpha weight on target class index.

@DeeDiveT
Copy link
Author

DeeDiveT commented Aug 17, 2019

It seems that $balance_index will not be used when the type of $$\alpha$$ is integer.

So, what does the balance_index actually do ?

thx.

@ksarma
Copy link

ksarma commented Aug 17, 2019

@DeeDive Alpha should be between 0 and 1 and reflects the relative weight of the classes. For example, if you have binary classification and you want to overweight the positive (index 1) class, I believe you can set alpha=0.7 and balance_index to 1. Then the alpha matrix will have all 0.3 (i.e. 1-alpha) for column 0, and 0.7 for column 1. This is used then for weighting the loss later in the computation

@DeeDiveT
Copy link
Author

DeeDiveT commented Aug 17, 2019 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

3 participants