Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Quantiles Methods not working #66

Closed
Rovel opened this issue Jan 16, 2020 · 6 comments
Closed

Quantiles Methods not working #66

Rovel opened this issue Jan 16, 2020 · 6 comments
Labels
release: minor PR merge results in a new minor version type: bug Something isn't working

Comments

@Rovel
Copy link

Rovel commented Jan 16, 2020

Hi,

I'm trying to apply different quantile methods to match a report made in another lib used by Re-Dash but it seem as I change the quantiles the graph value does not change.
Example Code:
https://codepen.io/Rovel/pen/RwwdzbG

Reference Issue:
getredash/redash#4428

@Rovel Rovel changed the title quantiles not working Quantiles Methods not working Jan 16, 2020
@sgratzl
Copy link
Contributor

sgratzl commented Jan 17, 2020

  1. you have to change the quantiles method in the "xAxes" since you have a horizontal box plot
  2. even if you change it to e.g. fivenum in my test the results don't change even with the different method.

@Rovel
Copy link
Author

Rovel commented Jan 20, 2020

@sgratzl yes I tried this too, xAxes and try actually all available quantiles methods and nothing changes, not sure if is a thing in the horizontal Box, but with numpy and other command line libs the value change, so I must infer that is something in the horizontal box and quantiles methods in this lib, can you confirm that the quantiles methods are working in the horizontal box plot?
Thanks

@sgratzl
Copy link
Contributor

sgratzl commented Jan 21, 2020

can you give a dataset in which you can see different results and also the code (e.g python,...) how to compute the various formats? The different methods that are currently implemented show an effect especially on dataset with an even number of elements since they essentially have different methods to combine two values for q1, q3, median, ...

@sgratzl sgratzl added release: patch PR merge results in a new patch version type: bug Something isn't working labels Jan 21, 2020
@Rovel
Copy link
Author

Rovel commented Jan 22, 2020

Hi,

See if this is is enought info, 11 numbers, evaluationg only q3 but from here we can test the others too...

Here follows a dataset and a example running with python 3.8.1 with the numpy lib:

>>> import numpy as np
>>> x = [3.375, 3.75, 3.875, 3, 3, 3.5, 3.125, 3, 2.625, 3.375, 3]
>>> np.percentile(x, 75, interpolation='linear')
3.4375
>>> np.percentile(x, 75, interpolation='higher')
3.5
>>> np.percentile(x, 75, interpolation='lower')
3.375
>>> np.percentile(x, 75, interpolation='nearest')
3.5
>>> np.percentile(x, 75, interpolation='midpoint')
3.4375

@sgratzl
Copy link
Contributor

sgratzl commented Jan 22, 2020

I see, there seem to be numerous versions how to compute the value in case you have to interpolate it.

So far this library implements two methods taken from R

The latter was added to be the same as when using the R boxplot function.

However, I can take a look to also implement the other methods. A PR is also welcome

@sgratzl sgratzl self-assigned this Jan 22, 2020
@sgratzl sgratzl added release: minor PR merge results in a new minor version and removed release: patch PR merge results in a new patch version labels Jan 22, 2020
@Rovel
Copy link
Author

Rovel commented Jan 27, 2020

sure I will try to help with a PR or something, but since JS is not my strong suit it will probably need a good review 😃

@sgratzl sgratzl removed their assignment Dec 11, 2020
@ghost ghost closed this as completed Nov 25, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release: minor PR merge results in a new minor version type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants