Download SubTask Datasets: Python & R Instructions
-
Install trialbench:
pip install trialbench
-
Manually download mesh_embeddings.txt.gz:
Download mesh_embeddings.txt.gzCopy it to the trialbench data directory:cp mesh_embeddings.txt.gz your_path_to/miniconda3/envs/trialbench/lib/python3.10/site-packages/trialbench/data/mesh-embeddings/ -
Download and load datasets:
import trialbench # Download all datasets (optional) trialbench.function.download_all_data('data/') # Load data task = 'dose' phase = 'All' # Dataloader format train_loader, valid_loader, test_loader, num_classes, tabular_input_dim = trialbench.function.load_data(task, phase, data_format='dl') # Or as Pandas DataFrame train_df, valid_df, test_df, num_classes, tabular_input_dim = trialbench.function.load_data(task, phase, data_format='df')
-
Download R package:
Please download r.trialbench_0.0.0.9000.tar.gz from here.
After downloading, decompress it:tar -xzvf r.trialbench_0.0.0.9000.tar.gz -
Install dependencies and Python environment:
install.packages("reticulate") library(reticulate) conda_create("r_trialbench", python_version = "3.10") use_condaenv("r_trialbench") reticulate::py_install("trialbench", pip = TRUE)
-
Manually download mesh_embeddings.txt.gz:
Download mesh_embeddings.txt.gzCopy it to the trialbench data directory:cp mesh_embeddings.txt.gz your_path_to/miniconda3/envs/r_trialbench/lib/python3.10/site-packages/trialbench/data/mesh-embeddings/ -
Source the R functions and load data:
# Load R functions (replace with your actual path) source("your_path_to/r.trialbench/R/function.R", encoding = "UTF-8") # Download all datasets (optional) download_all_data("data/") # Load data task <- "dose" phase <- "All" data_list <- load_data(task, phase) train_df <- data_list$train_df valid_df <- data_list$valid_df test_df <- data_list$test_df