-
Notifications
You must be signed in to change notification settings - Fork 0
Description
In config/study.py the target metric is defined as
target_metric: str | list[str] = field(validator=[validate_metric])
This creates type errors like
octopus/modules/efs/core.py:333: error: Argument 1 to "get_metric_function" of "MetricsInventory" has incompatible type "str | list[str]"; expected "str" [arg-type]
Current Problems:
- Type ambiguity: The str | list[str] union causes type errors everywhere
- Redundancy: There are already two fields doing similar things:
- target_metric: str | list[str] - optimization metric (+ optional extras)
- metrics: list - metrics to calculate (defaults to target_metric) - Inconsistent usage: Different modules handle it differently:
- EFS, SFS, RFE, Boruta, AutoGluon: str | list[str]
- Training, Enssel, Bag: str only - Unclear intent: When target_metric=["AUCROC", "ACC"], it's not obvious that only AUCROC is used for optimization
A possible solution would be to implement something like
@define
class ConfigStudy:
target_metric: str = field(validator=[validate_metric])
"""The single metric used for optimization."""
metrics_for_results: list[str] = field(
default=Factory(lambda self: [self.target_metric], takes_self=True),
validator=[validators.instance_of(list), validate_metric]
)
"""Additional metrics to calculate for reporting (includes target_metric by default)."""
Reactions are currently unavailable