Interfaces


source

BASECFMODULE

CLASS relax.methods.base.BaseCFModule ()

Base CF Explanation Module.


source

BASECFMODULE.NAME

relax.methods.base.BaseCFModule.name ()

Name of the CF Explanation Module.


source

BASECFMODULE.DATA_MODULE

relax.methods.base.BaseCFModule.data_module ()

Binded DataModule.


source

BASECFMODULE.GENERATE_CFS

relax.methods.base.BaseCFModule.generate_cfs (X, pred_fn=None)

Abstract method to generate counterfactuals

.. deprecated:: 0.1.4

Parameters:
  • X (jnp.ndarray) – Input to be explained
  • pred_fn (Callable, default=None) – Predictive function
Returns:

    (jnp.ndarray) – Generated counterfactuals


source

BASECFMODULE.HOOK_DATA_MODULE

relax.methods.base.BaseCFModule.hook_data_module (data_module)

Bind TabularDataModule to self._data_module.


source

BASEPARAMETRICCFMODULE

CLASS relax.methods.base.BaseParametricCFModule ()

Helper class that provides a standard way to create an ABC using inheritance.


source

BASEPARAMETRICCFMODULE.TRAIN

relax.methods.base.BaseParametricCFModule.train (datamodule, t_configs=None, pred_fn=None)

Parameters:
  • datamodule (TabularDataModule) – data module
  • t_configs (TrainingConfigs | dict, default=None) – training configs; see docs in TrainingConfigs
  • pred_fn (Callable, default=None) – predictive function

source

BASEPREDFNCFMODULE

CLASS relax.methods.base.BasePredFnCFModule ()

Base class of CF Module with a predictive module.

<string>:1: DeprecationWarning: jax.numpy.DeviceArray is deprecated. Use jax.Array.

source

BASEPREDFNCFMODULE.PRED_FN

relax.methods.base.BasePredFnCFModule.pred_fn (X)

Parameters:
  • X (jnp.DeviceArray) – input X
Returns:

    (jnp.DeviceArray) – prediction