percentile

percentile#

Find the q-th percentile of an input sequence. q is a value between 0 and 100 representing the percentile. A value of 0 is equivalent to mean, 100 is max, and 50 is the median when using the LINEAR method.

Note

Multiple q values are not supported yet

Supported methods for interpolation are: LINEAR, HAZEN, WEIBULL, LOWER, HIGHER, MIDPOINT, NEAREST, MEDIAN_UNBIASED, and NORMAL_UNBIASED

template<typename InType>
__MATX_INLINE__ auto matx::percentile(const InType &in, unsigned char q, PercentileMethod method = PercentileMethod::LINEAR)#

Compute product of numbers

Returns a tensor representing the product of all items in the reduction

Template Parameters:

InType – Input data type

Parameters:
  • in – Input data to reduce

  • q – Percentile to compute (between 0-100)

  • method – Method of interpolation

Returns:

Operator with reduced values of prod-reduce computed

template<typename InType, int D>
__MATX_INLINE__ auto matx::percentile(const InType &in, unsigned char q, const int (&dims)[D], PercentileMethod method = PercentileMethod::LINEAR)#

Compute product of numbers along axes

Returns a tensor representing the product of all items in the reduction

Template Parameters:
  • InType – Input data type

  • D – Num of dimensions to reduce over

Parameters:
  • in – Input data to reduce

  • q – Percentile to compute (between 0-100)

  • dims – Array containing dimensions to compute over

  • method – Method of interpolation

Returns:

Operator with reduced values of prod-reduce computed

Examples#

// Find the 50th percentile value in `t1e` using linear interpolation between midpoints
(t0 = percentile(t1e, 50, PercentileMethod::LINEAR)).run(exec);