coco_pipe.decoding.targets#
Target-label resolution and grouped-cross-validation fold helpers.
Functions#
|
Resolve labels and leakage-safe groups from a |
|
Return the largest viable grouped fold count. |
Module Contents#
- coco_pipe.decoding.targets.prepare_target(container, target_spec, group_col='patient_group_id')#
Resolve labels and leakage-safe groups from a
~coco_pipe.io.DataContainer.Binary targets require an explicit
positive_class. This prevents alphabetical class ordering from silently changing ROC-AUC, precision, recall, and F1 semantics.- Parameters:
container (coco_pipe.io.DataContainer)
target_spec (collections.abc.Mapping[str, Any])
group_col (str)
- Return type:
tuple[coco_pipe.io.DataContainer, numpy.ndarray, numpy.ndarray, pandas.DataFrame]
- coco_pipe.decoding.targets.safe_group_n_splits(y, groups, requested=5, stratified=True)#
Return the largest viable grouped fold count.
- Parameters:
y (collections.abc.Sequence[Any])
groups (collections.abc.Sequence[Any])
requested (int)
stratified (bool)
- Return type: