During the conversion from a sparse Möbius representation to another index, sometimes many value 0 interactions are added to the returned InteractionValues.
This is because interactions are added to the interaction_dict, even if their coefficient is 0.
|
val_distributed = distribution_weights[moebius_size, len(interaction)] |
|
# Check if Möbius value is distributed onto this interaction |
|
if interaction in base_interaction_dict: |
|
base_interaction_dict[interaction] += moebius_val * val_distributed |
|
else: |
|
base_interaction_dict[interaction] = moebius_val * val_distributed |
|
val_distributed = distribution_weights[moebius_size, len(interaction)] |
|
# Check if Möbius value is distributed onto this interaction |
|
if interaction in stii_dict: |
|
stii_dict[interaction] += moebius_val * val_distributed |
|
else: |
|
stii_dict[interaction] = moebius_val * val_distributed |
|
val_distributed = distribution_weights[moebius_size, len(interaction)] |
|
# Check if Möbius value is distributed onto this interaction |
|
if interaction in fii_dict: |
|
fii_dict[interaction] += moebius_val * val_distributed |
|
else: |
|
fii_dict[interaction] = moebius_val * val_distributed |
Alternatively, the returned InteractionValue could be sparsified upon return.
During the conversion from a sparse Möbius representation to another index, sometimes many value 0 interactions are added to the returned InteractionValues.
This is because interactions are added to the interaction_dict, even if their coefficient is 0.
shapiq/shapiq/game_theory/moebius_converter.py
Lines 125 to 130 in f3e9e7f
shapiq/shapiq/game_theory/moebius_converter.py
Lines 199 to 204 in f3e9e7f
shapiq/shapiq/game_theory/moebius_converter.py
Lines 275 to 280 in f3e9e7f
Alternatively, the returned InteractionValue could be sparsified upon return.