From f3d96852cef1ad5737b5500606b7f9f2e6b39fa9 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 4 Jun 2024 17:56:28 +0200 Subject: [PATCH] apply suggestions from Elior (See Eliorkalfon/single_cell_pb#11) --- src/task/methods/transformer_ensemble/script.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/task/methods/transformer_ensemble/script.py b/src/task/methods/transformer_ensemble/script.py index 79764953..398e504a 100644 --- a/src/task/methods/transformer_ensemble/script.py +++ b/src/task/methods/transformer_ensemble/script.py @@ -55,6 +55,7 @@ "uncommon": False, "sampling_strategy": "random", "weight": 0.5, + "validation_percentage": 0.1, }, # Note by author - weight_df2: 0.25 (excluding uncommon elements, resulting in 0.559) { @@ -62,11 +63,13 @@ "uncommon": True, "sampling_strategy": "random", "weight": 0.25, + "validation_percentage": 0.1, + }, # Note by author - weight_df3: 0.25 (leveraging clustering sampling, achieving 0.575) { "mean_std": "mean_std", - "uncommon": False, # should this be set to False or True? + "uncommon": False, "sampling_strategy": "k-means", "weight": 0.25, }, @@ -76,6 +79,7 @@ "uncommon": False, "sampling_strategy": "random", "weight": 0.3, + "validation_percentage": 0.1, } ] @@ -113,8 +117,8 @@ num_epochs=par["num_train_epochs"], early_stopping=par["early_stopping"], batch_size=par["batch_size"], - device=device, mean_std=argset["mean_std"], + device=device, ) elif argset["sampling_strategy"] == "random": label_reducer, scaler, transformer_model = train_non_k_means_strategy( @@ -125,8 +129,9 @@ num_epochs=par["num_train_epochs"], early_stopping=par["early_stopping"], batch_size=par["batch_size"], - device=device, mean_std=argset["mean_std"], + validation_percentage=argset["validation_percentage"], + device=device, ) else: raise ValueError("Invalid sampling_strategy argument")