mne_rt.combiners.GeometricMeanCombiner#
- class mne_rt.combiners.GeometricMeanCombiner(features: list[str], weights: dict[str, float] | None = None, floor: float = 1e-09)[source]#
Bases:
FeatureCombinerGeometric mean of (positive) feature values.
Computes the weighted geometric mean:
mixed = exp( Σ(wᵢ · log(max(xᵢ, floor))) / Σ(wᵢ) )
with uniform weights
wᵢ = 1when weights isNone. Input values are clipped to floor before the log transform so that zero or negative inputs do not causeNaNor−inf.Best suited for features that are inherently positive and multiplicative, such as band-power ratios, coherence values, or connectivity measures.
- Parameters:
Examples
Equal-weight geometric mean of three power features:
from mne_rt.combiners import GeometricMeanCombiner combiner = GeometricMeanCombiner( features=["sensor_power", "band_ratio", "individual_peak_power"] ) mixed = combiner.combine({ "sensor_power": 2.0, "band_ratio": 0.5, "individual_peak_power": 1.0, }) # mixed = (2.0 * 0.5 * 1.0) ** (1/3) ≈ 1.0
Weighted exponents (emphasise sensor_power):
combiner = GeometricMeanCombiner( features=["sensor_power", "band_ratio"], weights={"sensor_power": 2.0, "band_ratio": 1.0}, )
- __init__(features: list[str], weights: dict[str, float] | None = None, floor: float = 1e-09) None[source]#
Methods