Configure TxGNN data splits
mainThe TxData.prepare_split() method allows you to choose different data partitioning strategies:
complex_disease: The systematic split used in the paper. Samples a set of diseases and moves all their treatments to the test set to ensure zero-shot capability.disease_area: Splits based on disease ontology. Moves all treatments for a specific disease area to the test set. Available areas:cell_proliferation,mental_health,cardiovascular,anemia,adrenal_gland,autoimmune,metabolic_disorder,diabetes,neurodigenerative.random: Randomly shuffles drug-disease pairs.disease_eval: Used for deploying/evaluating a specific disease. Setdisease_eval_idxto the index of the disease of interest to mask it and use others for context.full_graph: Trains on the entire network without masking. Uses 95% for training and 5% for validation (no test set).
# Example: Disease area split
TxData.prepare_split(split = 'cell_proliferation', seed = 42)
# Example: Evaluating a specific disease index
TxData.prepare_split(split = 'disease_eval', disease_eval_idx = 'XX')