diff --git a/c/mapping/mapper_bootstrap.c b/c/mapping/mapper_bootstrap.c index 143f9f962..22bca1561 100644 --- a/c/mapping/mapper_bootstrap.c +++ b/c/mapping/mapper_bootstrap.c @@ -30,7 +30,7 @@ static void mapper_bootstrap_usage(FILE* o, char* argv0, char* verb) { fprintf(o, "Usage: %s %s [options]\n", argv0, verb); fprintf(o, "Emits an n-sample, with replacement, of the input records.\n"); fprintf(o, "Options:\n"); - fprintf(o, "-n {number} NUmber of samples to output. Defaults to number of input records.\n"); + fprintf(o, "-n {number} Number of samples to output. Defaults to number of input records.\n"); fprintf(o, " Must be non-negative.\n"); } diff --git a/c/reg_test/expected/out b/c/reg_test/expected/out index b960f35f7..b8a332258 100644 --- a/c/reg_test/expected/out +++ b/c/reg_test/expected/out @@ -642,6 +642,44 @@ top_idx=1,x_top=9223372036854775808.000000,y_top=-9223372036854775808.000000 top_idx=2,x_top=9223372036854775808.000000,y_top=-9223372036854775808.000000 top_idx=3,x_top=9223372036854775808.000000,y_top=-9223372036854775808.000000 +mlr --seed 12345 bootstrap ./reg_test/input/abixy-het +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694 +a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006 +a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694 + +mlr --seed 12345 bootstrap -n 2 ./reg_test/input/abixy-het +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 + +mlr --seed 12345 bootstrap -n 20 ./reg_test/input/abixy-het +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +a=eks,bbb=wye,i=4,x=0.38139939387114097,y=0.13418874328430463 +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +a=zee,b=pan,i=6,x=0.5271261600918548,y=0.49322128674835697 +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694 +a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006 +a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694 +a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006 +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533 +a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 +aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 +a=eks,b=zee,iii=7,x=0.6117840605678454,y=0.1878849191181694 +aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +aaa=hat,bbb=wye,i=9,x=0.03144187646093577,y=0.7495507603507059 +a=pan,b=wye,i=10,x=0.5026260055412137,y=0.9526183602969864 +a=zee,b=wye,i=8,x=0.5985540091064224,yyy=0.976181385699006 + mlr --seed 12345 sample -k 2 ./reg_test/input/abixy-het aaa=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776 a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797 diff --git a/c/reg_test/run b/c/reg_test/run index a836dc7da..5fc20f737 100755 --- a/c/reg_test/run +++ b/c/reg_test/run @@ -179,6 +179,10 @@ run_mlr top -n 3 -f x,y --min $indir/near-ovf.dkvp run_mlr top -F -n 3 -f x,y $indir/near-ovf.dkvp run_mlr top -F -n 3 -f x,y --min $indir/near-ovf.dkvp +run_mlr --seed 12345 bootstrap $indir/abixy-het +run_mlr --seed 12345 bootstrap -n 2 $indir/abixy-het +run_mlr --seed 12345 bootstrap -n 20 $indir/abixy-het + run_mlr --seed 12345 sample -k 2 $indir/abixy-het run_mlr --seed 12345 sample -k 2 -g a $indir/abixy-het run_mlr --seed 12345 sample -k 2 -g a,b $indir/abixy-het diff --git a/doc/content-for-reference.html b/doc/content-for-reference.html index 3844b1dee..99867b745 100644 --- a/doc/content-for-reference.html +++ b/doc/content-for-reference.html @@ -326,6 +326,11 @@ POKI_RUN_COMMAND{{mlr --opprint bar --lo 0.4 --hi 0.6 -f x,y data/small}}HERE POKI_RUN_COMMAND{{mlr --opprint bar --auto -f x,y data/small}}HERE + +

bootstrap

+ +POKI_RUN_COMMAND{{mlr bootstrap --help}}HERE +

cat

diff --git a/doc/mlr.1.premade b/doc/mlr.1.premade index 53a9f4cf7..162a0b24b 100644 --- a/doc/mlr.1.premade +++ b/doc/mlr.1.premade @@ -2,12 +2,12 @@ .\" Title: mlr .\" Author: [see the "AUTHOR" section] .\" Generator: ./mkman.rb -.\" Date: 2016-01-07 +.\" Date: 2016-01-09 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "MILLER" "1" "2016-01-07" "\ \&" "\ \&" +.TH "MILLER" "1" "2016-01-09" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Portability definitions .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -127,9 +127,9 @@ output separator to the given value. .RS 0 .\} .nf - bar cat check count-distinct cut decimate filter grep group-by group-like - having-fields head histogram join label merge-fields put regularize rename - reorder sample sec2gmt sort stats1 stats2 step tac tail top uniq + bar bootstrap cat check count-distinct cut decimate filter grep group-by + group-like having-fields head histogram join label merge-fields put regularize + rename reorder sample sec2gmt sort stats1 stats2 step tac tail top uniq .fi .if n \{\ .RE @@ -326,6 +326,19 @@ Options: .fi .if n \{\ .RE +.SS "bootstrap" +.if n \{\ +.RS 0 +.\} +.nf +Usage: mlr bootstrap [options] +Emits an n-sample, with replacement, of the input records. +Options: +-n {number} Number of samples to output. Defaults to number of input records. + Must be non-negative. +.fi +.if n \{\ +.RE .SS "cat" .if n \{\ .RS 0 @@ -726,7 +739,7 @@ mlr reorder -e -f a,b sends input record "d=4,b=2,a=1,c=3" to "d=4,c=3,a=1,b=2". .\} .nf Usage: mlr sample [options] -Reservoir sampling, optionally by category. +Reservoir sampling (subsampling without replacement), optionally by category. -k {count} Required: number of records to output, total, or by group if using -g. -g {a,b,c} Optional: group-by-field names for samples. .fi diff --git a/doc/reference.html b/doc/reference.html index bef1d0af5..44a995b23 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -146,6 +146,7 @@ Miller commands were run with pretty-print-tabular output format.     • Number formatting
• Data transformations
    • bar
+    • bootstrap
    • cat
    • check
    • decimate
@@ -337,9 +338,10 @@ Help options: --help-all-verbs Show help on all verbs. Verbs: - bar cat check count-distinct cut decimate filter grep group-by group-like - having-fields head histogram join label merge-fields put regularize rename - reorder sample sec2gmt sort stats1 stats2 step tac tail top uniq + bar bootstrap cat check count-distinct cut decimate filter grep group-by + group-like having-fields head histogram join label merge-fields put + regularize rename reorder sample sec2gmt sort stats1 stats2 step tac tail + top uniq Functions for the filter and put verbs: + + - - * / // % ** | ^ & ~ << >> == != =~ !=~ > >= < <= && || ^^ ! boolean @@ -907,6 +909,22 @@ wye pan 5 [0.204603]**************************..............[0.75868] [0.134189]

+ +

bootstrap

+ +

+

+
+$ mlr bootstrap --help
+Usage: mlr bootstrap [options]
+Emits an n-sample, with replacement, of the input records.
+Options:
+-n {number} Number of samples to output. Defaults to number of input records.
+            Must be non-negative.
+
+
+

+

cat

@@ -2258,7 +2276,7 @@ wye 0.5732889198020006 0.8636244699032729 5 pan
 $ mlr sample --help
 Usage: mlr sample [options]
-Reservoir sampling, optionally by category.
+Reservoir sampling (subsampling without replacement), optionally by category.
 -k {count}    Required: number of records to output, total, or by group if using -g.
 -g {a,b,c}    Optional: group-by-field names for samples.