peal.adaptors.interfaces.AdaptorConfig

class peal.adaptors.interfaces.AdaptorConfig[source]

Bases: BaseModel

The config template for an adaptor.

Every adaptor config extends this model. The adaptor_type and category fields tell the yaml loader which pydantic class to instantiate; the remaining fields control reproducibility and how much intermediate output is produced.

Parameters:
  • adaptor_type (str) – Name of the adaptor implementation, e.g. "CFKD".

  • category (str) – Always "adaptor"; used to route the yaml to this config family.

  • seed (int or None) – Seed for all sources of randomness.

  • tracking_level (int) – Verbosity/caching level from 0 (silent) to 5 (everything).

  • calculate_explainer_stats (bool) – Whether to compute explainer statistics such as sparsity/diversity.

  • in_memory (bool) – Whether datasets are fully loaded into RAM.

Methods

Attributes

calculate_explainer_stats

Whether to calculate explainer stats like sparsity, diversity, etc.

category

The category of the config.

in_memory

Whether to load all datasets into the RAM or not.

seed

The seed of all randomness to make results reproducible.

tracking_level

How many intermediate results are cached an visualized.

adaptor_type

The type of adaptor that shall be used.

adaptor_type: str

The type of adaptor that shall be used. This is necessary to know which pydantic class to use when loading from yaml.

category: str = 'adaptor'

The category of the config. Can not be changed for adaptor. This is also necessary to identify which pydantic class to use when loading from yaml.

seed: int | None = 0

The seed of all randomness to make results reproducible.

tracking_level: int = 0

How many intermediate results are cached an visualized. 0 -> None >=1 -> only progress bars >=2 -> prints >=3 -> caching >=4 -> visualizations >=5 -> everything, including expensive visualizations and tracking of values not mentioned by papers

calculate_explainer_stats: bool = False

Whether to calculate explainer stats like sparsity, diversity, etc.

in_memory: bool = False

Whether to load all datasets into the RAM or not. Careful with big datasets!