You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by GitBox <gi...@apache.org> on 2022/07/05 08:52:57 UTC

[GitHub] [datasketches-java] jmalkin commented on a diff in pull request #403: KLL inclusive ranks and quantiles

jmalkin commented on code in PR #403:
URL: https://github.com/apache/datasketches-java/pull/403#discussion_r913542822


##########
src/main/java/org/apache/datasketches/kll/KllDoublesSketch.java:
##########
@@ -289,9 +334,20 @@ public double[] getQuantiles(final double[] fractions) {
    * A value of 2 will return the min and the max value. A value of 3 will return the min,
    * the median and the max value, etc.
    *
+   * @param inclusive if true, the fractional ranks are considered inclusive
    * @return array of approximations to the given fractions in the same order as given fractions
    * array.
    */
+  public double[] getQuantiles(final int numEvenlySpaced, final boolean inclusive) {
+    if (isEmpty()) { return null; }
+    return getQuantiles(org.apache.datasketches.Util.evenlySpaced(0.0, 1.0, numEvenlySpaced), inclusive);
+  }
+
+  /**
+   * Same as {@link #getQuantiles(int, boolean) getQuantiles(int numEvenlySpaced, false)}
+   * @param numEvenlySpaced number of evenly spaced fractional ranks
+   * @return quantiles
+   */
   public double[] getQuantiles(final int numEvenlySpaced) {
     if (isEmpty()) { return null; }
     return getQuantiles(org.apache.datasketches.Util.evenlySpaced(0.0, 1.0, numEvenlySpaced));

Review Comment:
   Doesn't explicitly call getQuantiles with inclusive=false, although the effect is still the same. Shouldn't matter unless we break the API by changing the default behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org