pub fn defuzzification<KV>(
agg_memberships: &HashMap<String, Vec<Float>>,
vars: &HashMap<KV, Variable>,
) -> Result<HashMap<String, Float>>Expand description
Defuzzify aggregated membership samples using the centroid-of-area method.
For each entry in agg_memberships, the function reconstructs a uniform
x-grid from the variable’s domain and the vector length, then computes the
centroid Σ x[i]·μ[i] / Σ μ[i].
Type parameters and bounds:
KV: key type for the variables map; must borrow asstr.
Returns a map from output variable name to its crisp centroid value.
Errors
FuzzyError::BadArityif a membership vector has fewer than 2 samples.FuzzyError::NotFoundif a required output variable is missing fromvars.