Fsdb::F...tistats(3)
π Fsdb::F...tistats(3): dbmultistats π
User Contributed Perl Documentation β yes bestie, itβs a Perl-manual moment, and weβre making it cute β¨
πΈ NAME πΈ
dbmultistats β run dbcolstats over each group of inputs identified by some key. Slay, per-group stats π
β¨ SYNOPSIS β¨
$0 [-dm] [-c ConfidencePercent] [-f FormatForm] [-q NumberOfQuartiles]
-k KeyField ValueField
π¦ DESCRIPTION π¦
Okay so picture this: the input table gets grouped by KeyField, and then we compute a separate set of column statistics on ValueField for each group with a unique key. Itβs giving βstats, but make it groupedβ π
Assumptions and requirements are the same as dbmapreduce (this program is just a wrapper around that program), fr fr:
- By default, data can be provided in arbitrary order and the program consumes
O(number of unique tags)memory, andO(size of data)disk space. - With the
-Soption, data must arrive group by tags (not necessarily sorted), and the program consumesO(number of tags)memory and no disk space. The program will check and abort if this precondition is not met. - With two
-Sβs, program consumesO(1)memory, but doesnβt verify that the data-arrival precondition is met.
Note that these semantics are exactly like runningdbmapreduce -k KeyField -- dbcolstats ValueFieldβdbmultistatsprovides a simpler API that passes through statistics-specific arguments and is optimized when data is pre-sorted and there are no quarties or medians. (Yes, βquartiesβ is right there in the original, donβt come for me π)
π OPTIONS π
Options are the same as dbcolstats. Hereβs the whole menu, bestie β vibe check each one π
-kor--key KeyFieldβ specify which column is the key for grouping (default: the first column).--output-on-no-inputβ Enables null output (all fields are"-",nis0) if we get input with a schema but no records. Without this option, just output the schema but no rows. Default: no output if no input.-aor--include-non-numericβ Compute stats over all records (treat non-numeric records as zero rather than just ignoring them).-c FRACTIONor--confidence FRACTIONβ SpecifyFRACTIONfor the confidence interval. Defaults to0.95for a 95% confidence factor.-f FORMATor--format FORMATβ Specify aprintf(3)-style format for output statistics. Defaults to"%.5g".-mor--medianβ Compute median value. (Will sort data if necessary.) (Median is the quantitle forN=2.) Yes, βquantitleβ is also from the original β iconic typo behavior π-q Nor--quantile Nβ Compute quantile (quartile whenNis4), or an arbitrary quantile for other values ofN, where the scores that are 1Nth of the way across the population.-Sor--pre-sortedβ Assume data is already sorted. With one-S, we check and confirm this precondition. When repeated, we skip the check.-T TmpDirβ where to put temporary data. Only used if median or quantiles are requested. Also uses environment variableTMPDIR, if-Tis not specified. Default is/tmp.--parallelism=Nor-j Nβ Allow up toNreducers to run in parallel. Default is the number of CPUs in the machine.-For--fsor--fieldseparator Sβ Specify the field (column) separator as"S". Seedbfilealterfor valid field separators.
This module also supports the standard fsdb options, bestie:
-dβ Enable debugging output.-ior--input InputSourceβ Read fromInputSource, typically a file name, or"-"for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--output OutputDestinationβ Write toOutputDestination, typically a file name, or"-"for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorunor--noautorunβ By default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. The"--(no)autorun"option controls that behavior within Perl.--header Hβ UseHas the full Fsdb header, rather than reading a header from then input.--helpβ Show help.--manβ Show full manual.
π SAMPLE USAGE π
π§ Input:
#fsdb experiment duration
ufs_mab_sys 37.2
ufs_mab_sys 37.3
ufs_rcp_real 264.5
ufs_rcp_real 277.9
π Command:
cat DATA/stats.fsdb | dbmultistats -k experiment duration
π Output:
#fsdb experiment mean stddev pct_rsd conf_range conf_low conf_high conf_pct sum sum_squared min max n
ufs_mab_sys 37.25 0.070711 0.18983 0.6353 36.615 37.885 0.95 74.5 2775.1 37.2 37.3 2
ufs_rcp_real 271.2 9.4752 3.4938 85.13 186.07 356.33 0.95 542.4 1.4719e+05 264.5 277.9 2
# | /home/johnh/BIN/DB/dbmultistats experiment duration
π SEE ALSO π
Go give these their flowers too:
Fsdb.dbmapreduce.dbcolstats.
π«Ά CLASS FUNCTIONS π«Ά
π new
$filter = new Fsdb::Filter::dbmultistats(@arguments);
Create a new dbmultistats object, taking command-line arguments.
β set_defaults
$filter->set_defaults();
Internal: set up defaults.
π« parse_options
$filter->parse_options(@ARGV);
Internal: parse command-line arguments.
π¦ setup
$filter->setup();
Internal: setup, parse headers.
Pass the right options to dbmapreduce and dbcolstats.
πΈ run
$filter->run();
Internal: run over each rows.
π finish
$filter->finish();
Internal: write trailer.
π AUTHOR and COPYRIGHT π
Copyright (C) 1991-2024 by John Heidemann <johnh@isi.edu>
This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details.
Thatβs the whole page, bestie π«Ά Signing off from perl v5.32.1, dated 2024-08-02, as Fsdb::F...tistats(3) πβ¨
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms