mantispy.pp.decorr_threshold_sweep#
- mantispy.pp.decorr_threshold_sweep(adata, thresholds, scorers, *, key='selected', **feature_select_kwargs)[source]#
Score
decorrelateat a range of thresholds so the smallest set that holds a metric can be chosen.decorr_thresholdtrades size for signal, and the right setting depends on the screen and on the metric that matters, so there is no universal best. This runsfeature_select()withdecorrelate=Trueat each threshold on a copy, scores the selected object with each callable, and returns one row per threshold.- Parameters:
adata (
AnnData) – Object to select features on. Never modified.thresholds (
Sequence[float]) –decorr_thresholdvalues to try.scorers (
Mapping[str,Callable[[AnnData],float]] |Sequence[Callable[[AnnData],float]]) – Scoring callables, each taking the selectedAnnDataand returning a scalar (for example replicate or activity mAP). A mapping names the columns; a sequence names them bycallable.__name__.key (
str(default:'selected')) – Booleanvarcolumnfeature_select()writes andsubset_features()reads.feature_select_kwargs (
Any) – Passed through tofeature_select()(operations,corr_threshold, and so on);decorrelate,decorr_threshold,key_addedandcopyare set here.
- Return type:
- Returns:
A frame with a
thresholdcolumn, ann_keptcolumn, and one column per scorer.