alibi_detect.saving.validate module

alibi_detect.saving.validate.validate_config(cfg, resolved=False)[source]

Validates a detector config dict by passing the dict to the detector’s pydantic model schema.

Parameters:
  • cfg (dict) – The detector config dict.

  • resolved (bool) – Whether the config is resolved or not. For example, if resolved=True, x_ref is expected to be a np.ndarray, wheras if resolved=False, x_ref is expected to be a str.

Return type:

dict

Returns:

The validated config dict, with missing fields set to their default values.