modeva.TestSuite.interpret_local_moe_weights#
- TestSuite.interpret_local_moe_weights(dataset: str = 'test', sample_index: int = 0)#
Calculate and visualize expert weights for a specific sample.
- Parameters:
dataset ({"main", "train", "test"}, default="test") – The dataset containing the sample to analyze.
sample_index (int, default=0) – The index of the sample in the selected dataset.
- Returns:
Contains mixture-of-experts weight analysis:
key: “interpret_local_moe_weights”
data: Name of the dataset used
model: Name of the model used
inputs: Input parameters
value: Dictionary with expert names, weights, feature names and values
options: Dictionary of visualizations configuration for a bar plot where x-axis is expert id, and y-axis is the expert weights. Run results.plot() to show this plot.
- Return type:
Examples