MCPcopy Create free account
hub / github.com/apache/datafusion / mean

Method mean

datafusion/expr-common/src/statistics.rs:121–129  ·  view source on GitHub ↗

Extracts the mean value of this uncertain quantity, depending on its distribution: - A [`Uniform`] distribution's interval determines its mean value, which is the arithmetic average of the interval endpoints. - An [`Exponential`] distribution's mean is calculable by the formula `offset + 1 / λ`, where `λ` is the (non-negative) rate. - A [`Gaussian`] distribution contains the mean explicitly. - A [

(&self)

Source from the content-addressed store, hash-verified

119 /// - A [`Generic`] distribution _may_ have it explicitly, or this information
120 /// may be absent.
121 pub fn mean(&self) -> Result<ScalarValue> {
122 match &self {
123 Uniform(u) => u.mean(),
124 Exponential(e) => e.mean(),
125 Gaussian(g) => Ok(g.mean().clone()),
126 Bernoulli(b) => Ok(b.mean().clone()),
127 Generic(u) => Ok(u.mean().clone()),
128 }
129 }
130
131 /// Extracts the median value of this uncertain quantity, depending on its
132 /// distribution:

Callers 6

evaluate_statisticsMethod · 0.45
medianMethod · 0.45
combine_gaussiansFunction · 0.45
compute_meanFunction · 0.45
compute_medianFunction · 0.45
compute_varianceFunction · 0.45

Calls 8

add_checkedMethod · 0.80
lowerMethod · 0.80
upperMethod · 0.80
sub_checkedMethod · 0.80
cloneMethod · 0.45
data_typeMethod · 0.45
cast_toMethod · 0.45
divMethod · 0.45

Tested by

no test coverage detected