Fix weights#52
Open
JonathanZailer wants to merge 1 commit intoCamDavidsonPilon:masterfrom
JonathanZailer:patch-1
Open
Fix weights#52JonathanZailer wants to merge 1 commit intoCamDavidsonPilon:masterfrom JonathanZailer:patch-1
JonathanZailer wants to merge 1 commit intoCamDavidsonPilon:masterfrom
JonathanZailer:patch-1
Conversation
it seems like the weights were in wrong order
Owner
|
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? |
Contributor
Author
|
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>
.
|
Contributor
Author
|
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>
> .
>
|
This file contains hidden or 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
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.