tsv_utils.common.numerics

Numeric related utilities used by TSV Utilities.

Utilities in this file:

  • formatNumber - An alternate print format for numbers, especially useful when doubles are being used to represent integer and float values.
  • rangeMedian - Finds the median value of a range.
  • quantile - Generates quantile values for a data set.

Copyright (c) 2016-2019, eBay Software Foundation Initially written by Jon Degenhardt

Members

Enums

QuantileInterpolation
enum QuantileInterpolation

The different quantile interpolation methods. See: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html

Functions

formatNumber
auto formatNumber(T num, const size_t floatPrecision = 12)

formatNumber is an alternate way to print numbers. It is especially useful when representing both integral and floating point values with float point data types.

quantile
double quantile(const ProbType prob, Range data, QuantileInterpolation method = QuantileInterpolation.R7)

Returns the quantile in a data vector for a cumulative probability.

rangeMedian
auto rangeMedian(Range r)

rangeMedian. Finds the median. Modifies the range via topN or sort in the process.

Meta