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

what's the x and y? #1

Open
chamwen opened this issue Apr 21, 2018 · 2 comments
Open

what's the x and y? #1

chamwen opened this issue Apr 21, 2018 · 2 comments

Comments

@chamwen
Copy link

chamwen commented Apr 21, 2018

An excellent package for Density Ratio Estimation, but for a greener, how to get the x, y variables confused me. For example, with a train data and test data, the x means a sample in train data? the y means a sample in test data? If so, how can we get a y that associated with x ?

@ytakashina
Copy link

ytakashina commented Apr 27, 2018

It seems (to me) the comment in densratio.densratio is a bit confusing.

"""Estimate Density Ratio p(x)/q(y)
Args:
x: sample from p(x).
y: sample from p(y).

Maybe the comment can be modified as follows:

"""Estimate Density Ratio p(x)/q(x).
Args:
x: sample from p(x).
y: sample from q(x).

where p(x) and q(x) denote the test/train distributions on the same random variable X.

@chamwen

the x means a sample in train data? the y means a sample in test data?

I think x is a sample from a test distribution p(x), while y denotes a sample from a training distribution q(x).

how can we get a y that associated with x ?

Once the parameters are learned from samples using densratio.densratio(x, y), you can compute the density ratio on x_new with uLSIF.compute_density_ratio(x_new). The uLSIF object is returned from densratio.densratio(x, y).

See also: http://www.jmlr.org/papers/volume10/kanamori09a/kanamori09a.pdf.

@ameya98
Copy link
Contributor

ameya98 commented Apr 13, 2019

This should be a lot clearer in the code now. To answer the above questions, suppose you have n samples x1 from a distribution p(x), and n samples x2 from a distribution q(x). Then, densratio estimates w(x) = p(x)/q(x). It can now even estimate the alpha-relative density ratio, as well as the alpha-relative PE-divergence and KL-divergence between p(x) and q(x).

hoxo-m added a commit to hoxo-m/densratio that referenced this issue Jun 30, 2019
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