tirank.TrainPre.Predict
- tirank.TrainPre.Predict(savePath, mode, do_reject=True, tolerance=0.05, reject_mode='GMM')[source]
Performs inference using the best trained TiRank model.
This function loads the best model, loads the full bulk and sc/st gene pair matrices, and predicts scores for all samples. It then applies the chosen rejection (filtering) method to classify cells/spots as ‘Rank+’, ‘Rank-’, or ‘Background’. The final results are saved to ‘spot_predict_score.csv’ and ‘final_anndata.h5ad’.
- Parameters:
savePath (str) – The main project directory path.
mode (str) – The analysis mode (‘Cox’, ‘Classification’, ‘Regression’).
do_reject (bool, optional) – Whether to perform the GMM-based rejection. Defaults to True.
tolerance (float, optional) – The tolerance parameter for the rejection method. Defaults to 0.05.
reject_mode (str, optional) – The rejection method to use (‘GMM’ or ‘Strict’). Defaults to “GMM”.
- Returns:
None