Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 class-distinctiveness function and its example code #215
Add class-distinctiveness function and its example code #215
Changes from 2 commits
91a4d44
be06868
d9eb91b
84c594e
f06d261
7f1e39c
1aa2cd1
a593525
1732f75
c24ceb6
fc6a6c0
5567fc2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write the formula for class distinctiveness value for k classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I’m not super comfortable with the current formula of class distinctiveness.
Because Fisher criterion is defined as the ratio of the variance between the classes to the variance within the classes.
IMO, I think all distances in code should be at a power of 2.
We can solve this difference, adding a parameter
p
being the exponent of power:p=2
will measure class dispersions with respect means, ie Frechet variances minimized during means estimation;p=1
will measure class dispersions with respect medians, ie standard deviations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a quick update, but when I was writing the formula for the documentation, I realized that my implementation of the second commit did not correctly reflect the equation of multi-class distinctiveness (Equation 7 in the original paper). I am sorry for that. I will modify it in the third commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I am not sure if I fully understood your suggestion of using parameter p. That would be a different equation than the original paper's one, wouldn't it?
https://iopscience.iop.org/article/10.1088/1741-2552/aac577/meta?casa_token=bZ_Sz-fcfXIAAAAA:_lr-H99Z4_Y-GrbxMgL6ELEOvx03b8I4Xa7gedXTciHcUdvz5TzQhGCZ1WGcKqNOOpWWRmbVKXx5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the article, a power of 2 was lost bewteen Eq(4) and Eq(5), giving a mean absolute deviation instead of a variance.
I suggest to add an argument$p$ :
$$\mathrm{classDis}(A, B, p) = \frac{d \left(\bar{X}^{A}, \bar{X}^{B}\right)^p} {\frac{1}{2} \left( \sigma_{X^{A}}^p + \sigma_{X^{B}}^p \right)}$$
$$\sigma_{X^{K}}^p = \frac{1}{m} \sum_{i=1}^m d \left(X_i, \bar{X}^{K}\right)^p$$ $p=1$ , it gives equation from article.$p=2$ , it really generalizes Fisher criterion, defined as the ratio of the variance between the classes to the variance within the classes.
where
When
When
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the clear explanation! I got it!
Indeed, it is good for the user that they can choose from the two ways of quantification by the parameter p.
Thank you so much for the suggestion:-)