phenotypic.tune.infer_group_key#

phenotypic.tune.infer_group_key(scorer: Any) str | None[source]#

Infer the held-out grouping column from a count scorer.

Reads scorer.check.groupby[0] — the first column the QC count objective groups plates by — so a run’s held-out grouping defaults to the same unit the objective already compares. Returns None when the scorer has no resolvable check.groupby (e.g. a reference-free or composite scorer), letting the caller fall back to the within-group / data-poor tiers.

Parameters:

scorer (Any) – A tuning scorer; only scorer.check.groupby is read.

Returns:

The first groupby column name, or None when unavailable.

Return type:

str | None