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

Add getValueQuantile and unit-test. #401

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

reconditesea
Copy link
Contributor

Add getValueQuantile and unit-test.
Fix a bug (at least I think it is) in trueQuantile.

val quantilePoints = quantiles.map { q: Double =>
val (lower, upper) = quantileBounds(q)
(lower, upper, q)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a few comments:

  1. how do you know there is only one item in this list?
  2. I am confused about the algorithm have >= and 1.0 in both cases. Can you comment a bit?

It seems to me that you want something like:
quantilePoints.filter { case @b(l, u) => (l <= value && value <= u) }
Why is that not what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking situations like this:
Given an ordered and unique list of quantiles, e.g. [0, 0.1, 0.2, 0.3,... 0.9, 1.0] and specific value x. This method will return the estimated quantile for x in this QT. Wondering if this is a valid and common use case?

Since the list is ordered and unique, there will be only one item in the list. Also It's possible that x's quantile is somewhere b/w the two items in the list. For example, x's quantile is 0.25 which is in the middle of [0.2, 0.3]. In this case, I think it should return the the interval as lower and upper bound. So that's why the algorithm uses >= to do the filtering. The 1.0 is because if no bounds in the QT is larger than value x, then I think its quantile should be 1.0 since it's larger than all values in this QT.
Does this make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnynek Does the above make sense to you?

@ianoc
Copy link
Collaborator

ianoc commented Aug 4, 2015

Sorry my bad, git foo on cmd line broke stuff and closed all of these

@ianoc ianoc reopened this Aug 4, 2015
@CLAassistant
Copy link

CLAassistant commented Jul 18, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

None yet

4 participants