tirank.Visualization.evaluate_on_test_data
- tirank.Visualization.evaluate_on_test_data(model, test_set, data_path, save_path, bulk_gene_pairs_mat)[source]
Evaluates the model on external bulk RNA-seq test datasets.
This function iterates through a list of test dataset IDs. For each dataset, it loads the expression and clinical metadata, transforms the expression data into the gene-pair format, predicts labels using the model, and saves the predictions along with a confusion matrix plot.
- Parameters:
model (torch.nn.Module) – The trained classification model.
test_set (list of str) – A list of dataset identifiers (e.g., [‘GSE_ID1’]) to be loaded from data_path.
data_path (str) – The directory containing the test data files, which should be named like ‘{data_id}_meta.csv’ and ‘{data_id}_exp.csv’.
save_path (str) – The root directory where results will be saved. A ‘bulk_test’ subdirectory will be created here.
bulk_gene_pairs_mat (pd.DataFrame) – The gene-pair matrix used as a template to transform the test expression data.
- Returns:
None