lib.evaluator.config
Load an EvaluatorConfig from a plain dict or a YAML file.
Pipelines carry evaluator configuration as a proto Struct, which arrives
here as ordinary Python dicts. These loaders turn that into the typed schema
objects the rest of the evaluator works with.
load_config_from_dict
def load_config_from_dict(config_dict: dict[str, Any]) -> EvaluatorConfig
Build an EvaluatorConfig from a nested dict.
Arguments:
config_dict- Mapping with ametricslist. Each entry needsnameandmetric;params,columns, andfilter_exprare optional.
Returns:
The parsed configuration.
load_config_from_yaml
def load_config_from_yaml(yaml_path: str) -> EvaluatorConfig
Build an EvaluatorConfig from a YAML file.
Arguments:
yaml_path- Path to a YAML document with the same shapeload_config_from_dictexpects.
Returns:
The parsed configuration.