mmc.define_external_holdout()
- mmochi.classifier.define_external_holdout(adata, key_added='lin', holdout_mask=None, holdout_fraction=0.2, overwrite=False)
Creates column in .obsm[key_added] with randomly selected holdout for benchmarking its performance against other tools. To ensure this data is held out from thresholding and classification, pass external_holdout=True to both functions. To perform peak detection with this data excluded, invert this mask and pass it to inclusion_mask in landmark_register_adts or update_landmark_register
Note: By default if external holdout already exists, this function will not overwrite the current holdout column
- Parameters:
adata (
AnnData) – AnnData object containing events to set aside for hold outkey_added (
str(default:'lin')) – Will add external_holdout column to .obsm[key_added] if it exists and will also create .obsm[key_added] dataframe if it does notholdout_fraction (
Union[float,int] (default:0.2)) – Either a proportion (if less than or equal to 1) or number (if greater than 1) of events to set aside for external hold outoverwrite (
bool(default:False)) – Whether to replace old external hold out column if one exists