tirank.TrainPre.Reject_With_StrictNumber
- tirank.TrainPre.Reject_With_StrictNumber(pred_bulk, pred_sc, tolerance)[source]
Performs rejection based on a strict percentile range.
Fits a 2-component GMM to bulk scores to find means and std deviations. It then defines an acceptance range based on the percentile (tolerance) of a normal distribution (e.g., tolerance=0.95 keeps the central 95% of each bulk cluster).
- Parameters:
pred_bulk (np.ndarray) – Predicted scores from the bulk data (n_samples, 1).
pred_sc (np.ndarray) – Predicted scores from the sc/st data (n_cells, 1).
tolerance (float) – The percentile of the distribution to keep (e.g., 0.95).
- Returns:
A binary mask (n_cells, 1) where 1 indicates rejection.
- Return type:
np.ndarray