-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix weights #52
Open
JonathanZailer
wants to merge
1
commit into
CamDavidsonPilon:master
Choose a base branch
from
JonathanZailer:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix weights #52
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it seems like the weights were in wrong order
Hi @JonathanZailer, there is a failing test related to the percentile change: https://travis-ci.org/github/CamDavidsonPilon/tdigest/jobs/669282786 Can you detail why you think they should be switched? |
Hey,
From the code we have the next variables:
ci - the current bucket
ci_plus_1 - the next bucket
"k = (c_i_plus_one.count + c_i.count) / 2." which mean that k is the
"step" and distance between the centers of the buckets
From last loop we have t which is the total distance seen so far "t += k"
"z1 = p - t" means the distance from the center ci
"z2 = t + k - p" means the distance from the center of ci_plus_1
Therefore, the weighted arithmetic mean here is wrong "(c_i.mean * z2 +
c_i_plus_one.mean * z1) / (z1 + z2)"
The distance to ci_plus_1 is multiplied by c_i_plus_one.mean and vice versa.
My fix was to change z1 to z2 and z2 to z1 in the weighted arithmetic mean.
בתאריך יום ד׳, 1 באפר׳ 2020 ב-3:09 מאת Cameron Davidson-Pilon <
notifications@github.com>:
… Hi @JonathanZailer <https://github.com/JonathanZailer>, there is a
failing test related to the percentile change:
https://travis-ci.org/github/CamDavidsonPilon/tdigest/jobs/669282786
Can you detail why you think they should be switched?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN4W257UWGJXBNMFSVIPSADRKKA35ANCNFSM4LXTXV7Q>
.
|
Hey,
I know why the test failed.
I'll try to see if I can add another fix to the code.(commit)
FYI- I didn't want to divide into the test but I was curious why it failed
:)
Good day,
Jonathan
בתאריך יום ד׳, 1 באפר׳ 2020 ב-11:48 מאת jonathan zailer <
jonathan.zailer@gmail.com>:
… Hey,
From the code we have the next variables:
ci - the current bucket
ci_plus_1 - the next bucket
"k = (c_i_plus_one.count + c_i.count) / 2." which mean that k is the
"step" and distance between the centers of the buckets
From last loop we have t which is the total distance seen so far "t += k"
"z1 = p - t" means the distance from the center ci
"z2 = t + k - p" means the distance from the center of ci_plus_1
Therefore, the weighted arithmetic mean here is wrong "(c_i.mean * z2 +
c_i_plus_one.mean * z1) / (z1 + z2)"
The distance to ci_plus_1 is multiplied by c_i_plus_one.mean and vice
versa.
My fix was to change z1 to z2 and z2 to z1 in the weighted arithmetic
mean.
בתאריך יום ד׳, 1 באפר׳ 2020 ב-3:09 מאת Cameron Davidson-Pilon <
***@***.***>:
> Hi @JonathanZailer <https://github.com/JonathanZailer>, there is a
> failing test related to the percentile change:
> https://travis-ci.org/github/CamDavidsonPilon/tdigest/jobs/669282786
>
> Can you detail why you think they should be switched?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#52 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AN4W257UWGJXBNMFSVIPSADRKKA35ANCNFSM4LXTXV7Q>
> .
>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If I'm not mistaken the weights are in wrong order.