You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2024/09/21 23:08:43 UTC

(datasketches-website) branch update_sampling_toc created (now b865baac)

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a change to branch update_sampling_toc
in repository https://gitbox.apache.org/repos/asf/datasketches-website.git


      at b865baac update sampling toc

This branch includes the following new commits:

     new b865baac update sampling toc

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


(datasketches-website) 01/01: update sampling toc

Posted by le...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch update_sampling_toc
in repository https://gitbox.apache.org/repos/asf/datasketches-website.git

commit b865baac4558421d2b2c2f1f79a30d8df6e78094
Author: Lee Rhodes <le...@gmail.com>
AuthorDate: Sat Sep 21 16:08:31 2024 -0700

    update sampling toc
---
 _includes/toc.html                                     | 15 ++-------------
 ...servoirSampling.md => ReservoirSamplingSketches.md} | 18 +++++++++++++++---
 .../{VarOptSampling.md => VarOptSamplingSketches.md}   | 16 ++++++++++++----
 src/main/resources/docgen/toc.json                     | 14 ++------------
 4 files changed, 31 insertions(+), 32 deletions(-)

diff --git a/_includes/toc.html b/_includes/toc.html
index 609aa7bb..d5a9f45b 100644
--- a/_includes/toc.html
+++ b/_includes/toc.html
@@ -108,19 +108,8 @@
       <a data-toggle="collapse" class="menu collapsed" href="#collapse_sampling">Sampling</a>
     </p>
     <div class="collapse" id="collapse_sampling">
-      <li><a href="{{site.docs_dir}}/Sampling/ReservoirSampling.html">•Reservoir Sampling</a></li>
-      <li><a href="{{site.docs_dir}}/Sampling/ReservoirSamplingPerformance.html">•Reservoir Sampling Performance</a></li>
-      <li><a href="{{site.docs_dir}}/Sampling/VarOptSampling.html">•VarOpt Sampling</a></li>
-
-      <p id="sampling-examples">
-        <a data-toggle="collapse" class="menu collapsed" href="#collapse_sampling_examples">Sampling Examples</a>
-      </p>
-      <div class="collapse" id="collapse_sampling_examples">
-        <li><a href="{{site.docs_dir}}/Sampling/ReservoirSamplingJava.html">•Reservoir Sampling Java Example</a></li>
-        <li><a href="{{site.docs_dir}}/Sampling/ReservoirSamplingPigUDFs.html">•Reservoir Sampling Pig UDFs</a></li>
-        <li><a href="{{site.docs_dir}}/Sampling/VarOptSamplingJava.html">•VarOpt Sampling Java Example</a></li>
-        <li><a href="{{site.docs_dir}}/Sampling/VarOptPigUDFs.html">•VarOpt Sampling Pig UDFs</a></li>
-      </div>
+      <li><a href="{{site.docs_dir}}/Sampling/ReservoirSamplingSketches.html">•Reservoir Sampling Sketches</a></li>
+      <li><a href="{{site.docs_dir}}/Sampling/VarOptSamplingSketches.html">•VarOpt Sampling Sketches</a></li>
     </div>
   </div>
 
diff --git a/docs/Sampling/ReservoirSampling.md b/docs/Sampling/ReservoirSamplingSketches.md
similarity index 83%
rename from docs/Sampling/ReservoirSampling.md
rename to docs/Sampling/ReservoirSamplingSketches.md
index 0df59783..f1bda332 100644
--- a/docs/Sampling/ReservoirSampling.md
+++ b/docs/Sampling/ReservoirSamplingSketches.md
@@ -19,9 +19,21 @@ layout: doc_page
     specific language governing permissions and limitations
     under the License.
 -->
-## Reservoir Sampling
-
-Reservoir sampling provides a way to construct a uniform random sample of size <tt>k</tt> from an unweighted stream of items, without knowing the final length of the stream in advance. As with all sketches in the library, reservoir sampling sketches can be efficiently unioned.
+## Contents
+<!-- TOC -->
+
+* [Reservoir Sampling Sketches](#reservoir-sampling-sketches)
+    * [Reservoir Sampling Performance](https://datasketches.apache.org/docs/Sampling/ReservoirSamplingPerformance.html)
+    * Reservoir Sampling Examples
+        * [Reservoir Sampling Java Example](https://datasketches.apache.org/docs/Sampling/ReservoirSamplingJava.html)
+        * [Reservoir Sampling Pig UDFs](https://datasketches.apache.org/docs/Sampling/ReservoirSamplingPigUDFs.html)
+ 
+<!-- TOC -->
+
+<a id="reservoir-sampling-sketches"></a>
+## Reservoir Sampling Sketches
+Reservoir sampling provides a way to construct a uniform random sample of size <tt>k</tt> from an unweighted stream of items, 
+without knowing the final length of the stream in advance. As with all sketches in the library, reservoir sampling sketches can be efficiently unioned.
 
 The Sketches Library provides 2 forms of reservoir sampling sketches:
 
diff --git a/docs/Sampling/VarOptSampling.md b/docs/Sampling/VarOptSamplingSketches.md
similarity index 89%
rename from docs/Sampling/VarOptSampling.md
rename to docs/Sampling/VarOptSamplingSketches.md
index 4bbff40b..0f49d3ee 100644
--- a/docs/Sampling/VarOptSampling.md
+++ b/docs/Sampling/VarOptSamplingSketches.md
@@ -19,8 +19,16 @@ layout: doc_page
     specific language governing permissions and limitations
     under the License.
 -->
-## VarOpt Sampling
-
+## Contents
+<!-- TOC -->
+* [VarOpt Sampling Sketches](#varopt-sampling-sketches)
+* VarOpt Sampling Examples
+    * [VarOpt Sampling Java Example](https://datasketches.apache.org/docs/Sampling/VarOptSamplingJava.html)
+    * [VarOpt Sampling Pig UDFs](https://datasketches.apache.org/docs/Sampling/VarOptPigUDFs.html)  
+<!-- TOC -->
+
+<a id="varopt-sampling-sketches"></a>
+## VarOpt Sampling Sketches
 VarOpt sampling allows one to construct a random sample of weighted items from a stream. Like with reservoir sampling, varopt sampling does not require knowing the final length of the stream in advance. As with all sketches in the library, varopt sampling sketches can be efficiently unioned.
 
 The name VarOpt refers to the sketch's property of producing estimates of subset sums with optimal variance for a given sketch size, <tt>k</tt>. If we apply a predicate to the items in a varopt sample and, the sum of weights (which may be adjusted by the sketching process) of items matching that predicate will estimate the sum of weights of matching items from the entire stream with provably minimal variance.
@@ -59,7 +67,7 @@ duplicate items if the input stream contains duplicates.
 
 ### More on VarOpt Sampling
 
-The basic VarOpt algorithm was first presented by Cohen et al<sup>1</sup>. We have modified and extended that work to allow for unions of VarOpt samples, producing a result that remains a valid VarOpt sketch.
+The basic VarOpt algorithm was first presented by Cohen et al[^1]. We have modified and extended that work to allow for unions of VarOpt samples, producing a result that remains a valid VarOpt sketch.
 
 The underlying goal of VarOpt sampling is to provide the best possible estimate of subset sums of items in the sample. As an example, we might select a sample o size <tt>k</tt> from the ~3200 counties (a political administrative region below the level of a state) in the United States, using the county population as the weight. We could then apply a predicate to our sample -- for instance, counties in the state of California -- and sum the resulting weights. That sum is our estimate of th [...]
 
@@ -78,4 +86,4 @@ When extracting items from a sketch, the heavy items retain their original weigh
 
 When using VarOpt with uniform input weights, for instance giving all items a weight of 1.0, the sketch will perform standard reservoir sampling. Similarly, if operating over an infinite stream of items with finite weights, there will also be no heavy items and the sketch will return a standard weighted sample of items.
 
-1. E. Cohen, N. G. Guffield, H. Kapla, C. Lund, M. Thorup, <em>Efficient Stream Sampling for Variance-Optimal Estimation of Subset Sums</em>, SIAM J. Comput. 40(5): 1402-1431, 2011.
+[^1]: E. Cohen, N. G. Guffield, H. Kapla, C. Lund, M. Thorup, <em>Efficient Stream Sampling for Variance-Optimal Estimation of Subset Sums</em>, SIAM J. Comput. 40(5): 1402-1431, 2011.
diff --git a/src/main/resources/docgen/toc.json b/src/main/resources/docgen/toc.json
index 584597b4..a25f9457 100644
--- a/src/main/resources/docgen/toc.json
+++ b/src/main/resources/docgen/toc.json
@@ -88,18 +88,8 @@
 
         { "class":"Dropdown", "desc" : "Sampling", "array":
           [
-            {"class":"Doc",  "desc" : "Reservoir Sampling",               "dir" : "Sampling", "file": "ReservoirSampling" },
-            {"class":"Doc",  "desc" : "Reservoir Sampling Performance",   "dir" : "Sampling", "file": "ReservoirSamplingPerformance" },
-            {"class":"Doc",  "desc" : "VarOpt Sampling",                  "dir" : "Sampling", "file": "VarOptSampling" },
-
-            { "class":"Dropdown", "desc" : "Sampling Examples", "array":
-              [
-                {"class":"Doc",  "desc" : "Reservoir Sampling Java Example",  "dir" : "Sampling", "file": "ReservoirSamplingJava" },
-                {"class":"Doc",  "desc" : "Reservoir Sampling Pig UDFs",      "dir" : "Sampling", "file": "ReservoirSamplingPigUDFs" },
-                {"class":"Doc",  "desc" : "VarOpt Sampling Java Example",     "dir" : "Sampling", "file": "VarOptSamplingJava" },
-                {"class":"Doc",  "desc" : "VarOpt Sampling Pig UDFs",         "dir" : "Sampling", "file": "VarOptPigUDFs" },
-              ]
-            },
+            {"class":"Doc",  "desc" : "Reservoir Sampling Sketches",      "dir" : "Sampling", "file": "ReservoirSamplingSketches" },
+            {"class":"Doc",  "desc" : "VarOpt Sampling Sketches",                  "dir" : "Sampling", "file": "VarOptSamplingSketches" },
           ]
         },
       ]


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