-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Cookbook for chi_square distance #4324
Conversation
… the chi_square distance
Chi Square Distance | ||
=================== | ||
|
||
The Chi Square Distance for real valued features x and x' extends the concept of :math:`\chi^{2}` metric to negative values. |
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.
since you are using x and x' downstream, pls put them into (inline) math mode here as well
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.
We need more clarity here :-) The distance extends the concept of the metric, what does this mean? I think distance and metric are commonly used interchangeably. Explain specifically what is meant by extending to negative values.
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 we have some updates here pls? :)
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.
@iglesias @karlnapf The classical chi square distance is defined as:
This is for only positive values. However, the implementation in shogun is for both positive and negative values, since the denominator is (|x_i|+|y_i|) so it extends the chi square distance to the negative values too. Is this more clear?
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.
To some extent. What reference are you using for this classical definition?
From I have read after checking shortly out there, a use case of this Chi-2 distance is to calculate distance between histograms. In that use case the values are positive of course. I suppose that people found other use cases where values are not necessary positive. I suspect that this dichotomy you have observed (definitions with and without the absolute value) may come from there.
It is fine for me if you want to leave the text as it is. I would not play with saying the distance extends the concept of metric to negative values since because I find it rather vague and potentially misleading.
|
||
.. math:: | ||
|
||
d(\bf{x},\bf{x'}) = \sum_{i=1}^{n}\frac{(x_{i}-x'_{i})^2}{|x_{i}|+|x'_{i}|} \quad \bf{x},\bf{x'} \in R^{n} |
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.
n is undefined
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.
Should I add "for any natural number n" ?
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.
I think it should be fine for defining n if you just put that the features belong to R^n the first time you introduce them. By the way, for extra mathy happiness, use \mathbb with R 🤓
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.
Thanks for this!
@shubham808 @vinx13 @FaroukY Pls let this be the last "distance" cookbook. We have enough of those already. (meta examples still need to be ported)
Can |
Chi Square Distance | ||
=================== | ||
|
||
The Chi Square Distance for real valued features x and x' extends the concept of :math:`\chi^{2}` metric to negative values. |
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.
We need more clarity here :-) The distance extends the concept of the metric, what does this mean? I think distance and metric are commonly used interchangeably. Explain specifically what is meant by extending to negative values.
…ion of the metric
8d4dbcb
to
7b397be
Compare
thx |
* updated csv_file in chi_square.sg to new api and wrote a cookbook for the chi_square distance
No description provided.