Skip to content

Moebius_converter adds many value 0 interactions during conversion #369

@landonbutler

Description

@landonbutler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    game theory 🎲📕Game theory related issuesmaintenance 🔨Code enhancements, tests and maintenance👌good first issueAn issue which should be a good first issue for getting into the library.

    Projects

    Status

    📋 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions