From 52bb1be05e5083d338f1c26e2ca640a4e4c473e9 Mon Sep 17 00:00:00 2001 From: Bora Uyar Date: Wed, 3 Jul 2024 20:13:00 +0200 Subject: [PATCH] make gnn default size smaller --- flexynesis/__main__.py | 5 +++-- flexynesis/config.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flexynesis/__main__.py b/flexynesis/__main__.py index 6aa05c6..e61a9f8 100644 --- a/flexynesis/__main__.py +++ b/flexynesis/__main__.py @@ -237,7 +237,8 @@ class AvailableModels(NamedTuple): # overlay datasets with network info # this is a temporary solution print("[INFO] Overlaying the dataset with network data from STRINGDB") - obj = STRING('STRING', "9606", "gene_name") + obj = STRING(os.path.join(args.data_path, '_'.join(['processed', args.prefix])), + args.string_organism, args.string_node_name) train_dataset = MultiOmicDatasetNW(train_dataset, obj.graph_df) train_dataset.print_stats() test_dataset = MultiOmicDatasetNW(test_dataset, obj.graph_df) @@ -310,7 +311,7 @@ class AvailableModels(NamedTuple): # compute feature importance values print("[INFO] Computing variable importance scores") for var in model.target_variables: - model.compute_feature_importance(train_dataset, var, steps = 50) + model.compute_feature_importance(train_dataset, var, steps = 25) df_imp = pd.concat([model.feature_importances[x] for x in model.target_variables], ignore_index = True) df_imp.to_csv(os.path.join(args.outdir, '.'.join([args.prefix, 'feature_importance.csv'])), header=True, index=False) diff --git a/flexynesis/config.py b/flexynesis/config.py index 1fef1c7..33eee1a 100644 --- a/flexynesis/config.py +++ b/flexynesis/config.py @@ -42,7 +42,7 @@ ], 'GNNEarly': [ Integer(16, 128, name='latent_dim'), - Real(0.2, 1, name='hidden_dim_factor'), # relative size of the hidden_dim w.r.t input_dim + Real(0.1, 0.25, name='hidden_dim_factor'), # relative size of the hidden_dim w.r.t input_dim Real(0.0001, 0.01, prior='log-uniform', name='lr'), Integer(8, 32, name='supervisor_hidden_dim'), Categorical(epochs, name='epochs'),