igc.naive.NaiveTTest#
- class igc.naive.NaiveTTest(module, dataset, dtld_kwargs=None, forward_method_name=None, forward_method_kwargs=None, dtype=torch.float32, dtype_cat=torch.int32)[source]#
Bases:
AbstractAttributionMethod
Naive two-sample t-tests between inputs corresponding to categories based on outputs characteristics.
- add_embedding_method(embedding_method_name, embedding_method_kwargs=None, embedding_n_cat=None)[source]#
Add an embedding method to preprocess categorical inputs.
Warning
This effect of this method must not excluded from the forward method defined by
forward_method_name
at initialization.- Parameters:
embedding_method_name (str) – Name of the embedding method of the
module
.embedding_method_kwargs (dict) – Additional keyword arguments to the embedding method of the
module
.embedding_n_cat (int) – Number of categorical inputs. If
None
, this value is inferred from the input data types (torch.int16
,torch.int32
,torch.int64
).
- Return type:
self
- compute(cat_ranges, y_idx=None, batch_size=None, x_seed=None, n_x=None)[source]#
Compute the naive two-sample t-tests between inputs corresponding to categories based on outputs characteristics.
It returns the p-value.
- Parameters:
cat_ranges (tuple(float))
y_idx (None | int | ArrayLike)
batch_size (int | tuple(int))
x_seed (None | int)
n_x (None | int)
- Return type:
ArrayLike | tuple(ArrayLike)