Utilities#

Exceptions#

Reproducibility#

utils.seed.seed_context(seed)[source]#
Parameters:

seed (int | None)

Caching#

utils.caching.get_cache_dir(sub)[source]#
Parameters:

sub (str)

Return type:

str

utils.caching.set_cache_dir(path)[source]#
Parameters:

path (str)

Return type:

None

Logging#

utils.logger.setup_logger(level='INFO', path=None, name='benchmark')[source]#
Parameters:
Return type:

Logger

Model helpers#

model.model_utils.resolve_device(device)[source]#
Parameters:

device (str)

Return type:

str

model.model_utils.logits_to_prediction(logits, proba=True, output_activation='softmax')[source]#
Parameters:
Return type:

torch.Tensor

Evaluation helpers#

evaluation.evaluation_utils.distance(factuals, counterfactuals, metric, binarize_list=[])[source]#
Parameters:
Return type:

torch.Tensor

evaluation.evaluation_utils.restore_features(*datasets, mode='categorical')[source]#
Parameters:
Return type:

tuple[DataFrame, …]

Preprocessing helpers#

preprocess.preprocess_utils.resolve_feature_metadata(dataset)[source]#
Parameters:

dataset (DatasetObject)

Return type:

tuple[dict[str, str], dict[str, bool], dict[str, str]]

Benchmark suites#