| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (9) on Fri Oct 01 19:18:48 PDT 2021 --> |
| <title>KllFloatsSketch (datasketches-java 3.1.0-SNAPSHOT API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="date" content="2021-10-01"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-1.10.2.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="KllFloatsSketch (datasketches-java 3.1.0-SNAPSHOT API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":9,"i3":9,"i4":10,"i5":10,"i6":10,"i7":10,"i8":9,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":9,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../";loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/KllFloatsSketch.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../org/apache/datasketches/kll/KllFloatsSketchIterator.html" title="class in org.apache.datasketches.kll"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/datasketches/kll/KllFloatsSketch.html" target="_top">Frames</a></li> |
| <li><a href="KllFloatsSketch.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><span>SEARCH: </span> |
| <input type="text" id="search" value=" " disabled="disabled"> |
| <input type="reset" id="reset" value=" " disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="../../../../org/apache/datasketches/kll/package-summary.html">org.apache.datasketches.kll</a></div> |
| <h2 title="Class KllFloatsSketch" class="title">Class KllFloatsSketch</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.datasketches.kll.KllFloatsSketch</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public class <span class="typeNameLabel">KllFloatsSketch</span> |
| extends <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block">Implementation of a very compact quantiles sketch with lazy compaction scheme |
| and nearly optimal accuracy per retained item. |
| See <a href="https://arxiv.org/abs/1603.05346v2">Optimal Quantile Approximation in Streams</a>. |
| |
| <p>This is a stochastic streaming sketch that enables near-real time analysis of the |
| approximate distribution of values from a very large stream in a single pass, requiring only |
| that the values are comparable. |
| The analysis is obtained using <i>getQuantile()</i> or <i>getQuantiles()</i> functions or the |
| inverse functions getRank(), getPMF() (Probability Mass Function), and getCDF() |
| (Cumulative Distribution Function). |
| |
| <p>Given an input stream of <i>N</i> numeric values, the <i>absolute rank</i> of any specific |
| value is defined as its index <i>(0 to N-1)</i> in the hypothetical sorted stream of all |
| <i>N</i> input values. |
| |
| <p>The <i>normalized rank</i> (<i>rank</i>) of any specific value is defined as its |
| <i>absolute rank</i> divided by <i>N</i>. |
| Thus, the <i>normalized rank</i> is a value between zero and one. |
| In the documentation and Javadocs for this sketch <i>absolute rank</i> is never used so any |
| reference to just <i>rank</i> should be interpreted to mean <i>normalized rank</i>. |
| |
| <p>This sketch is configured with a parameter <i>k</i>, which affects the size of the sketch |
| and its estimation error. |
| |
| <p>The estimation error is commonly called <i>epsilon</i> (or <i>eps</i>) and is a fraction |
| between zero and one. Larger values of <i>k</i> result in smaller values of epsilon. |
| Epsilon is always with respect to the rank and cannot be applied to the |
| corresponding values. |
| |
| <p>The relationship between the normalized rank and the corresponding values can be viewed |
| as a two dimensional monotonic plot with the normalized rank on one axis and the |
| corresponding values on the other axis. If the y-axis is specified as the value-axis and |
| the x-axis as the normalized rank, then <i>y = getQuantile(x)</i> is a monotonically |
| increasing function. |
| |
| <p>The functions <i>getQuantile(rank)</i> and getQuantiles(...) translate ranks into |
| corresponding values. The functions <i>getRank(value), |
| getCDF(...) (Cumulative Distribution Function), and getPMF(...) |
| (Probability Mass Function)</i> perform the opposite operation and translate values into ranks. |
| |
| <p>The <i>getPMF(...)</i> function has about 13 to 47% worse rank error (depending |
| on <i>k</i>) than the other queries because the mass of each "bin" of the PMF has |
| "double-sided" error from the upper and lower edges of the bin as a result of a subtraction, |
| as the errors from the two edges can sometimes add. |
| |
| <p>The default <i>k</i> of 200 yields a "single-sided" epsilon of about 1.33% and a |
| "double-sided" (PMF) epsilon of about 1.65%. |
| |
| <p>A <i>getQuantile(rank)</i> query has the following guarantees: |
| <ul> |
| <li>Let <i>v = getQuantile(r)</i> where <i>r</i> is the rank between zero and one.</li> |
| <li>The value <i>v</i> will be a value from the input stream.</li> |
| <li>Let <i>trueRank</i> be the true rank of <i>v</i> derived from the hypothetical sorted |
| stream of all <i>N</i> values.</li> |
| <li>Let <i>eps = getNormalizedRankError(false)</i>.</li> |
| <li>Then <i>r - eps ≤ trueRank ≤ r + eps</i> with a confidence of 99%. Note that the |
| error is on the rank, not the value.</li> |
| </ul> |
| |
| <p>A <i>getRank(value)</i> query has the following guarantees: |
| <ul> |
| <li>Let <i>r = getRank(v)</i> where <i>v</i> is a value between the min and max values of |
| the input stream.</li> |
| <li>Let <i>trueRank</i> be the true rank of <i>v</i> derived from the hypothetical sorted |
| stream of all <i>N</i> values.</li> |
| <li>Let <i>eps = getNormalizedRankError(false)</i>.</li> |
| <li>Then <i>r - eps ≤ trueRank ≤ r + eps</i> with a confidence of 99%.</li> |
| </ul> |
| |
| <p>A <i>getPMF(...)</i> query has the following guarantees: |
| <ul> |
| <li>Let <i>{r<sub>1</sub>, r<sub>2</sub>, ..., r<sub>m+1</sub>} |
| = getPMF(v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>m</sub>)</i> where |
| <i>v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>m</sub></i> are monotonically increasing values |
| supplied by the user that are part of the monotonic sequence |
| <i>v<sub>0</sub> = min, v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>m</sub>, v<sub>m+1</sub> = max</i>, |
| and where <i>min</i> and <i>max</i> are the actual minimum and maximum values of the input |
| stream automatically included in the sequence by the <i>getPMF(...)</i> function. |
| |
| <li>Let <i>r<sub>i</sub> = mass<sub>i</sub></i> = estimated mass between |
| <i>v<sub>i-1</sub></i> and <i>v<sub>i</sub></i> where <i>v<sub>0</sub> = min</i> |
| and <i>v<sub>m+1</sub> = max</i>.</li> |
| |
| <li>Let <i>trueMass</i> be the true mass between the values of <i>v<sub>i</sub>, |
| v<sub>i+1</sub></i> derived from the hypothetical sorted stream of all <i>N</i> values.</li> |
| <li>Let <i>eps = getNormalizedRankError(true)</i>.</li> |
| <li>Then <i>mass - eps ≤ trueMass ≤ mass + eps</i> with a confidence of 99%.</li> |
| <li><i>r<sub>1</sub></i> includes the mass of all points between <i>min = v<sub>0</sub></i> and |
| <i>v<sub>1</sub></i>.</li> |
| <li><i>r<sub>m+1</sub></i> includes the mass of all points between <i>v<sub>m</sub></i> and |
| <i>max = v<sub>m+1</sub></i>.</li> |
| </ul> |
| |
| <p>A <i>getCDF(...)</i> query has the following guarantees; |
| <ul> |
| <li>Let <i>{r<sub>1</sub>, r<sub>2</sub>, ..., r<sub>m+1</sub>} |
| = getCDF(v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>m</sub>)</i> where |
| <i>v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>m</sub>)</i> are monotonically increasing values |
| supplied by the user that are part of the monotonic sequence |
| <i>{v<sub>0</sub> = min, v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>m</sub>, v<sub>m+1</sub> = max}</i>, |
| and where <i>min</i> and <i>max</i> are the actual minimum and maximum values of the input |
| stream automatically included in the sequence by the <i>getCDF(...)</i> function. |
| |
| <li>Let <i>r<sub>i</sub> = mass<sub>i</sub></i> = estimated mass between |
| <i>v<sub>0</sub> = min</i> and <i>v<sub>i</sub></i>.</li> |
| |
| <li>Let <i>trueMass</i> be the true mass between the true ranks of <i>v<sub>i</sub>, |
| v<sub>i+1</sub></i> derived from the hypothetical sorted stream of all <i>N</i> values.</li> |
| <li>Let <i>eps = getNormalizedRankError(true)</i>.</li> |
| <li>then <i>mass - eps ≤ trueMass ≤ mass + eps</i> with a confidence of 99%.</li> |
| <li><i>r<sub>1</sub></i> includes the mass of all points between <i>min = v<sub>0</sub></i> and |
| <i>v<sub>1</sub></i>.</li> |
| <li><i>r<sub>m+1</sub></i> includes the mass of all points between <i>min = v<sub>0</sub></i> and |
| <i>max = v<sub>m+1</sub></i>.</li> |
| </ul> |
| |
| <p>From the above, it might seem like we could make some estimates to bound the |
| <em>value</em> returned from a call to <em>getQuantile()</em>. The sketch, however, does not |
| let us derive error bounds or confidences around values. Because errors are independent, we |
| can approximately bracket a value as shown below, but there are no error estimates available. |
| Additionally, the interval may be quite large for certain distributions. |
| <ul> |
| <li>Let <i>v = getQuantile(r)</i>, the estimated quantile value of rank <i>r</i>.</li> |
| <li>Let <i>eps = getNormalizedRankError(false)</i>.</li> |
| <li>Let <i>v<sub>lo</sub></i> = estimated quantile value of rank <i>(r - eps)</i>.</li> |
| <li>Let <i>v<sub>hi</sub></i> = estimated quantile value of rank <i>(r + eps)</i>.</li> |
| <li>Then <i>v<sub>lo</sub> ≤ v ≤ v<sub>hi</sub></i>, with 99% confidence.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Kevin Lang, Alexander Saydakov, Lee Rhodes</dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#DEFAULT_K">DEFAULT_K</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The default value of K.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#KllFloatsSketch--">KllFloatsSketch</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Heap constructor with the default <em>k = 200</em>, which has a rank error of about 1.65%.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#KllFloatsSketch-int-">KllFloatsSketch</a></span>​(int k)</code></th> |
| <td class="colLast"> |
| <div class="block">Heap constructor with a given parameter <em>k</em>.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>double[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getCDF-float:A-">getCDF</a></span>​(float[] splitPoints)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns an approximation to the Cumulative Distribution Function (CDF), which is the |
| cumulative analog of the PMF, of the input stream given a set of splitPoint (values).</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getK--">getK</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the parameter k</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getKFromEpsilon-double-boolean-">getKFromEpsilon</a></span>​(double epsilon, |
| boolean pmf)</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the approximate value of <em>k</em> to use given epsilon, the normalized rank error.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getMaxSerializedSizeBytes-int-long-">getMaxSerializedSizeBytes</a></span>​(int k, |
| long n)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns upper bound on the serialized size of a sketch given a parameter <em>k</em> and stream |
| length.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>float</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getMaxValue--">getMaxValue</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the max value of the stream.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>float</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getMinValue--">getMinValue</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the min value of the stream.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getN--">getN</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the length of the input stream.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getNormalizedRankError-boolean-">getNormalizedRankError</a></span>​(boolean pmf)</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the approximate rank error of this sketch normalized as a fraction between zero and one.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>static double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getNormalizedRankError-int-boolean-">getNormalizedRankError</a></span>​(int k, |
| boolean pmf)</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the normalized rank error given k and pmf.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getNumRetained--">getNumRetained</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of retained items (samples) in the sketch.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>double[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getPMF-float:A-">getPMF</a></span>​(float[] splitPoints)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns an approximation to the Probability Mass Function (PMF) of the input stream |
| given a set of splitPoints (values).</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>float</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getQuantile-double-">getQuantile</a></span>​(double fraction)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns an approximation to the value of the data item |
| that would be preceded by the given fraction of a hypothetical sorted |
| version of the input stream so far.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>float</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getQuantileLowerBound-double-">getQuantileLowerBound</a></span>​(double fraction)</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the lower bound of the value interval in which the true quantile of the given rank |
| exists with a confidence of at least 99%.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>float[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getQuantiles-double:A-">getQuantiles</a></span>​(double[] fractions)</code></th> |
| <td class="colLast"> |
| <div class="block">This is a more efficient multiple-query version of getQuantile().</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>float[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getQuantiles-int-">getQuantiles</a></span>​(int numEvenlySpaced)</code></th> |
| <td class="colLast"> |
| <div class="block">This is also a more efficient multiple-query version of getQuantile() and allows the caller to |
| specify the number of evenly spaced fractional ranks.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>float</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getQuantileUpperBound-double-">getQuantileUpperBound</a></span>​(double fraction)</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the upper bound of the value interval in which the true quantile of the given rank |
| exists with a confidence of at least 99%.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getRank-float-">getRank</a></span>​(float value)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns an approximation to the normalized (fractional) rank of the given value from 0 to 1, |
| inclusive.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getSerializedSizeBytes--">getSerializedSizeBytes</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of bytes this sketch would require to store.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>static <a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html" title="class in org.apache.datasketches.kll">KllFloatsSketch</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#heapify-org.apache.datasketches.memory.Memory-">heapify</a></span>​(org.apache.datasketches.memory.Memory mem)</code></th> |
| <td class="colLast"> |
| <div class="block">Factory heapify takes the sketch image in Memory and instantiates an on-heap sketch.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#isEmpty--">isEmpty</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns true if this sketch is empty.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#isEstimationMode--">isEstimationMode</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns true if this sketch is in estimation mode.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/datasketches/kll/KllFloatsSketchIterator.html" title="class in org.apache.datasketches.kll">KllFloatsSketchIterator</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#iterator--">iterator</a></span>​()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#merge-org.apache.datasketches.kll.KllFloatsSketch-">merge</a></span>​(<a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html" title="class in org.apache.datasketches.kll">KllFloatsSketch</a> other)</code></th> |
| <td class="colLast"> |
| <div class="block">Merges another sketch into this one.</div> |
| </td> |
| </tr> |
| <tr id="i23" class="rowColor"> |
| <td class="colFirst"><code>byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#toByteArray--">toByteArray</a></span>​()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns serialized sketch in a byte array form.</div> |
| </td> |
| </tr> |
| <tr id="i24" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#toString--">toString</a></span>​()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i25" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#toString-boolean-boolean-">toString</a></span>​(boolean withLevels, |
| boolean withData)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a summary of the sketch as a string.</div> |
| </td> |
| </tr> |
| <tr id="i26" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#update-float-">update</a></span>​(float value)</code></th> |
| <td class="colLast"> |
| <div class="block">Updates this sketch with the given data item.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="DEFAULT_K"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>DEFAULT_K</h4> |
| <pre>public static final int DEFAULT_K</pre> |
| <div class="block">The default value of K.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.apache.datasketches.kll.KllFloatsSketch.DEFAULT_K">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="KllFloatsSketch--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>KllFloatsSketch</h4> |
| <pre>public KllFloatsSketch​()</pre> |
| <div class="block">Heap constructor with the default <em>k = 200</em>, which has a rank error of about 1.65%.</div> |
| </li> |
| </ul> |
| <a name="KllFloatsSketch-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>KllFloatsSketch</h4> |
| <pre>public KllFloatsSketch​(int k)</pre> |
| <div class="block">Heap constructor with a given parameter <em>k</em>. <em>k</em> can be any value between 8 and |
| 65535, inclusive. The default <em>k</em> = 200 results in a normalized rank error of about |
| 1.65%. Higher values of K will have smaller error but the sketch will be larger (and slower).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>k</code> - parameter that controls size of the sketch and accuracy of estimates</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="heapify-org.apache.datasketches.memory.Memory-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>heapify</h4> |
| <pre>public static <a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html" title="class in org.apache.datasketches.kll">KllFloatsSketch</a> heapify​(org.apache.datasketches.memory.Memory mem)</pre> |
| <div class="block">Factory heapify takes the sketch image in Memory and instantiates an on-heap sketch. |
| The resulting sketch will not retain any link to the source Memory.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>mem</code> - a Memory image of a sketch serialized by this sketch. |
| <a href="../../../../resources/dictionary.html#mem">See Memory</a></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a heap-based sketch based on the given Memory.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCDF-float:A-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCDF</h4> |
| <pre>public double[] getCDF​(float[] splitPoints)</pre> |
| <div class="block">Returns an approximation to the Cumulative Distribution Function (CDF), which is the |
| cumulative analog of the PMF, of the input stream given a set of splitPoint (values). |
| |
| <p>The resulting approximations have a probabilistic guarantee that can be obtained from the |
| getNormalizedRankError(false) function. |
| |
| <p>If the sketch is empty this returns null.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>splitPoints</code> - an array of <i>m</i> unique, monotonically increasing float values |
| that divide the real number line into <i>m+1</i> consecutive disjoint intervals. |
| The definition of an "interval" is inclusive of the left splitPoint (or minimum value) and |
| exclusive of the right splitPoint, with the exception that the last interval will include |
| the maximum value. |
| It is not necessary to include either the min or max values in these split points.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an array of m+1 double values, which are a consecutive approximation to the CDF |
| of the input stream given the splitPoints. The value at array position j of the returned |
| CDF array is the sum of the returned values in positions 0 through j of the returned PMF |
| array.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getK--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getK</h4> |
| <pre>public int getK​()</pre> |
| <div class="block">Returns the parameter k</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>parameter k</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getKFromEpsilon-double-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getKFromEpsilon</h4> |
| <pre>public static int getKFromEpsilon​(double epsilon, |
| boolean pmf)</pre> |
| <div class="block">Gets the approximate value of <em>k</em> to use given epsilon, the normalized rank error.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>epsilon</code> - the normalized rank error between zero and one.</dd> |
| <dd><code>pmf</code> - if true, this function returns the value of <em>k</em> assuming the input epsilon |
| is the desired "double-sided" epsilon for the getPMF() function. Otherwise, this function |
| returns the value of <em>k</em> assuming the input epsilon is the desired "single-sided" |
| epsilon for all the other queries.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value of <i>k</i> given a value of epsilon.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html" title="class in org.apache.datasketches.kll"><code>KllFloatsSketch</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getMaxValue--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getMaxValue</h4> |
| <pre>public float getMaxValue​()</pre> |
| <div class="block">Returns the max value of the stream. |
| If the sketch is empty this returns NaN.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the max value of the stream</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getMinValue--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getMinValue</h4> |
| <pre>public float getMinValue​()</pre> |
| <div class="block">Returns the min value of the stream. |
| If the sketch is empty this returns NaN.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the min value of the stream</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getN--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getN</h4> |
| <pre>public long getN​()</pre> |
| <div class="block">Returns the length of the input stream.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>stream length</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getNormalizedRankError-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getNormalizedRankError</h4> |
| <pre>public double getNormalizedRankError​(boolean pmf)</pre> |
| <div class="block">Gets the approximate rank error of this sketch normalized as a fraction between zero and one.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>pmf</code> - if true, returns the "double-sided" normalized rank error for the getPMF() function. |
| Otherwise, it is the "single-sided" normalized rank error for all the other queries.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>if pmf is true, returns the normalized rank error for the getPMF() function. |
| Otherwise, it is the "single-sided" normalized rank error for all the other queries.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html" title="class in org.apache.datasketches.kll"><code>KllFloatsSketch</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getNormalizedRankError-int-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getNormalizedRankError</h4> |
| <pre>public static double getNormalizedRankError​(int k, |
| boolean pmf)</pre> |
| <div class="block">Gets the normalized rank error given k and pmf. |
| Static method version of the <a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html#getNormalizedRankError-boolean-"><code>getNormalizedRankError(boolean)</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>k</code> - the configuation parameter</dd> |
| <dd><code>pmf</code> - if true, returns the "double-sided" normalized rank error for the getPMF() function. |
| Otherwise, it is the "single-sided" normalized rank error for all the other queries.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>if pmf is true, the normalized rank error for the getPMF() function. |
| Otherwise, it is the "single-sided" normalized rank error for all the other queries.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html" title="class in org.apache.datasketches.kll"><code>KllFloatsSketch</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getNumRetained--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getNumRetained</h4> |
| <pre>public int getNumRetained​()</pre> |
| <div class="block">Returns the number of retained items (samples) in the sketch.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of retained items (samples) in the sketch</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getMaxSerializedSizeBytes-int-long-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getMaxSerializedSizeBytes</h4> |
| <pre>public static int getMaxSerializedSizeBytes​(int k, |
| long n)</pre> |
| <div class="block">Returns upper bound on the serialized size of a sketch given a parameter <em>k</em> and stream |
| length. The resulting size is an overestimate to make sure actual sketches don't exceed it. |
| This method can be used if allocation of storage is necessary beforehand, but it is not |
| optimal.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>k</code> - parameter that controls size of the sketch and accuracy of estimates</dd> |
| <dd><code>n</code> - stream length</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>upper bound on the serialized size</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getPMF-float:A-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getPMF</h4> |
| <pre>public double[] getPMF​(float[] splitPoints)</pre> |
| <div class="block">Returns an approximation to the Probability Mass Function (PMF) of the input stream |
| given a set of splitPoints (values). |
| |
| <p>The resulting approximations have a probabilistic guarantee that can be obtained from the |
| getNormalizedRankError(true) function. |
| |
| <p>If the sketch is empty this returns null.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>splitPoints</code> - an array of <i>m</i> unique, monotonically increasing float values |
| that divide the real number line into <i>m+1</i> consecutive disjoint intervals. |
| The definition of an "interval" is inclusive of the left splitPoint (or minimum value) and |
| exclusive of the right splitPoint, with the exception that the last interval will include |
| the maximum value. |
| It is not necessary to include either the min or max values in these split points.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an array of m+1 doubles each of which is an approximation |
| to the fraction of the input stream values (the mass) that fall into one of those intervals. |
| The definition of an "interval" is inclusive of the left splitPoint and exclusive of the right |
| splitPoint, with the exception that the last interval will include maximum value.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getQuantile-double-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getQuantile</h4> |
| <pre>public float getQuantile​(double fraction)</pre> |
| <div class="block">Returns an approximation to the value of the data item |
| that would be preceded by the given fraction of a hypothetical sorted |
| version of the input stream so far. |
| |
| <p>We note that this method has a fairly large overhead (microseconds instead of nanoseconds) |
| so it should not be called multiple times to get different quantiles from the same |
| sketch. Instead use getQuantiles(), which pays the overhead only once. |
| |
| <p>If the sketch is empty this returns NaN.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>fraction</code> - the specified fractional position in the hypothetical sorted stream. |
| These are also called normalized ranks or fractional ranks. |
| If fraction = 0.0, the true minimum value of the stream is returned. |
| If fraction = 1.0, the true maximum value of the stream is returned.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the approximation to the value at the given fraction</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getQuantileUpperBound-double-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getQuantileUpperBound</h4> |
| <pre>public float getQuantileUpperBound​(double fraction)</pre> |
| <div class="block">Gets the upper bound of the value interval in which the true quantile of the given rank |
| exists with a confidence of at least 99%.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>fraction</code> - the given normalized rank as a fraction</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the upper bound of the value interval in which the true quantile of the given rank |
| exists with a confidence of at least 99%. Returns NaN if the sketch is empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getQuantileLowerBound-double-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getQuantileLowerBound</h4> |
| <pre>public float getQuantileLowerBound​(double fraction)</pre> |
| <div class="block">Gets the lower bound of the value interval in which the true quantile of the given rank |
| exists with a confidence of at least 99%.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>fraction</code> - the given normalized rank as a fraction</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the lower bound of the value interval in which the true quantile of the given rank |
| exists with a confidence of at least 99%. Returns NaN if the sketch is empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getQuantiles-double:A-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getQuantiles</h4> |
| <pre>public float[] getQuantiles​(double[] fractions)</pre> |
| <div class="block">This is a more efficient multiple-query version of getQuantile(). |
| |
| <p>This returns an array that could have been generated by using getQuantile() with many |
| different fractional ranks, but would be very inefficient. |
| This method incurs the internal set-up overhead once and obtains multiple quantile values in |
| a single query. It is strongly recommend that this method be used instead of multiple calls |
| to getQuantile(). |
| |
| <p>If the sketch is empty this returns null.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>fractions</code> - given array of fractional positions in the hypothetical sorted stream. |
| These are also called normalized ranks or fractional ranks. |
| These fractions must be in the interval [0.0, 1.0], inclusive.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>array of approximations to the given fractions in the same order as given fractions |
| array.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getQuantiles-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getQuantiles</h4> |
| <pre>public float[] getQuantiles​(int numEvenlySpaced)</pre> |
| <div class="block">This is also a more efficient multiple-query version of getQuantile() and allows the caller to |
| specify the number of evenly spaced fractional ranks. |
| |
| <p>If the sketch is empty this returns null.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>numEvenlySpaced</code> - an integer that specifies the number of evenly spaced fractional ranks. |
| This must be a positive integer greater than 0. A value of 1 will return the min value. |
| 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.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>array of approximations to the given fractions in the same order as given fractions |
| array.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getRank-float-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getRank</h4> |
| <pre>public double getRank​(float value)</pre> |
| <div class="block">Returns an approximation to the normalized (fractional) rank of the given value from 0 to 1, |
| inclusive. |
| |
| <p>The resulting approximation has a probabilistic guarantee that can be obtained from the |
| getNormalizedRankError(false) function. |
| |
| <p>If the sketch is empty this returns NaN.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - to be ranked</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an approximate rank of the given value</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getSerializedSizeBytes--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSerializedSizeBytes</h4> |
| <pre>public int getSerializedSizeBytes​()</pre> |
| <div class="block">Returns the number of bytes this sketch would require to store.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of bytes this sketch would require to store.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isEmpty--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre>public boolean isEmpty​()</pre> |
| <div class="block">Returns true if this sketch is empty.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>empty flag</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isEstimationMode--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEstimationMode</h4> |
| <pre>public boolean isEstimationMode​()</pre> |
| <div class="block">Returns true if this sketch is in estimation mode.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>estimation mode flag</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="iterator--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>iterator</h4> |
| <pre>public <a href="../../../../org/apache/datasketches/kll/KllFloatsSketchIterator.html" title="class in org.apache.datasketches.kll">KllFloatsSketchIterator</a> iterator​()</pre> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the iterator for this class</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="merge-org.apache.datasketches.kll.KllFloatsSketch-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>merge</h4> |
| <pre>public void merge​(<a href="../../../../org/apache/datasketches/kll/KllFloatsSketch.html" title="class in org.apache.datasketches.kll">KllFloatsSketch</a> other)</pre> |
| <div class="block">Merges another sketch into this one.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>other</code> - sketch to merge into this one</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="toByteArray--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toByteArray</h4> |
| <pre>public byte[] toByteArray​()</pre> |
| <div class="block">Returns serialized sketch in a byte array form.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>serialized sketch in a byte array form.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="toString--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString​()</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code> in class <code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="toString-boolean-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString​(boolean withLevels, |
| boolean withData)</pre> |
| <div class="block">Returns a summary of the sketch as a string.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>withLevels</code> - if true include information about levels</dd> |
| <dd><code>withData</code> - if true include sketch data</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>string representation of sketch summary</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="update-float-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>update</h4> |
| <pre>public void update​(float value)</pre> |
| <div class="block">Updates this sketch with the given data item.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - an item from a stream of items. NaNs are ignored.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/KllFloatsSketch.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../org/apache/datasketches/kll/KllFloatsSketchIterator.html" title="class in org.apache.datasketches.kll"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/datasketches/kll/KllFloatsSketch.html" target="_top">Frames</a></li> |
| <li><a href="KllFloatsSketch.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2015–2021 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |