TDIGEST.TRIMMED_MEAN

Syntax
TDIGEST.TRIMMED_MEAN key low_cut_quantile high_cut_quantile
Available in:
Redis Stack / Bloom 2.4.0
Time complexity:
O(N) where N is the number of centroids

返回从草图中估计的平均值,不包括低和高截止分位数之外的观测值。

必需的参数

key is key name for an existing t-digest sketch.
low_cut_quantile

浮点值在范围 [0..1] 内,应小于 high_cut_quantile

当等于0时:无低切。

当高于0时:排除低于此分位数的观测值。

high_cut_quantile

浮点值在范围 [0..1] 内,应高于 low_cut_quantile

当低于1时:排除高于或等于此分位数的观测值。

当等于1时:无高切。

返回值

Simple string reply 平均值的估计。如果草图为空,则为'nan'。

示例

redis> TDIGEST.CREATE t COMPRESSION 1000
OK
redis> TDIGEST.ADD t 1 2 3 4 5 6 7 8 9 10
OK
redis> TDIGEST.TRIMMED_MEAN t 0.1 0.6
"4"
redis> TDIGEST.TRIMMED_MEAN t 0.3 0.9
"6.5"
redis> TDIGEST.TRIMMED_MEAN t 0 1
"5.5"

RATE THIS PAGE
Back to top ↑