cellmil.interfaces.SHAPExplainerConfig

Classes

SHAPExplainerConfig(*, output_path[, ...])

Configuration for SHAP explainability method.

SHAPExplainerType(value)

SHAP explainer types.

class cellmil.interfaces.SHAPExplainerConfig.SHAPExplainerType(value)[source]

Bases: str, Enum

SHAP explainer types.

gradient = 'gradient'
deep = 'deep'
kernel = 'kernel'
classmethod values()[source]
_generate_next_value_(start, count, last_values)

Generate the next value when not given.

name: the name of the member start: the initial start value or None count: the number of existing members last_value: the last value assigned or None

class cellmil.interfaces.SHAPExplainerConfig.SHAPExplainerConfig(*, output_path: Path, num_bins: int = 5, samples_per_bin: int = 10000, max_total_samples: Optional[int] = None, explainer_type: SHAPExplainerType = SHAPExplainerType.gradient, background_percentage: float = 0.2, nsamples: int = 500, explain_top_cells: Optional[int] = None, explain_per_head: bool = True, explain_mean_head: bool = True, top_features: int = 20, random_seed: int = 42, batch_size: int = 1024, save_raw_shap_values: bool = True, create_summary_plots: bool = True)[source]

Bases: BaseModel

Configuration for SHAP explainability method.

output_path: Path
num_bins: int
samples_per_bin: int
max_total_samples: Optional[int]
explainer_type: SHAPExplainerType
background_percentage: float
nsamples: int
explain_top_cells: Optional[int]
explain_per_head: bool
explain_mean_head: bool
top_features: int
random_seed: int
batch_size: int
save_raw_shap_values: bool
create_summary_plots: bool
classmethod validate_num_bins(v: int) int[source]
classmethod validate_samples_per_bin(v: int) int[source]
classmethod validate_background_percentage(v: float) float[source]
classmethod validate_nsamples(v: int) int[source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].