mne_rt.combiners.WeightedSumCombiner#
- class mne_rt.combiners.WeightedSumCombiner(weights: dict[str, float])[source]#
Bases:
FeatureCombinerWeighted linear combination of feature values.
Computes the weight-normalised linear blend:
mixed = Σ(wᵢ · xᵢ) / Σ(wᵢ)
where the sum runs only over features present in values. Normalising by the sum of active weights means the result is unaffected by how many features are missing in a given window.
- Parameters:
Notes
Returns
0.0if none of the specified features are present in values, with awarningsmessage.Examples
Alpha-power minus frontal asymmetry:
from mne_rt.combiners import WeightedSumCombiner combiner = WeightedSumCombiner( weights={"sensor_power": 0.6, "laterality": 0.4} ) mixed = combiner.combine({"sensor_power": 1.5, "laterality": 0.3}) # mixed ≈ 0.6*1.5/1.0 + 0.4*0.3/1.0 = 1.02
Suppressing one feature (negative weight):
combiner = WeightedSumCombiner( weights={"sensor_power": 1.0, "entropy": -0.5} )
Methods