From aa681234430ee9d704769ea011f991576003eea3 Mon Sep 17 00:00:00 2001 From: orisenbazuru Date: Wed, 26 Feb 2020 17:39:58 +0100 Subject: [PATCH] minor debugging with print statements --- ddi/dataset.py | 4 ++++ ddi/utilities.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ddi/dataset.py b/ddi/dataset.py index b55e772..0d393b6 100644 --- a/ddi/dataset.py +++ b/ddi/dataset.py @@ -96,10 +96,14 @@ def preprocess_labels(interaction_fpath): def create_setvector_features(X, num_sim_types): """reshape concatenated features from every similarity type matrix into set of vectors per ddi example""" e = X[np.newaxis, :, :] + # print('e.shape', e.shape) f = np.transpose(e, axes=(0, 2, 1)) + # print('f.shape', f.shape) splitter = 2*num_sim_types g = np.concatenate(np.split(f, splitter, axis=1), axis=0) + # print('g.shape', g.shape) h = np.transpose(g, axes=(2,0, 1)) + # print('h.shape', h.shape) return h def get_stratified_partitions(ddi_datatensor, num_folds=5, valid_set_portion=0.1, random_state=42): diff --git a/ddi/utilities.py b/ddi/utilities.py index bd7d329..68e1f57 100644 --- a/ddi/utilities.py +++ b/ddi/utilities.py @@ -39,6 +39,7 @@ def get_performance_results(similarity_type, target_dir, num_folds, dsettype): 'fold_{}'.format(fold_num)) score_file = os.path.join(fold_dir, 'score_{}.pkl'.format(dsettype)) + # print(score_file) if os.path.isfile(score_file): mscore = ReaderWriter.read_data(score_file) perf_dict[0]['fold{}'.format(fold_num)] = mscore.s_auc @@ -63,8 +64,9 @@ def build_performance_dfs(similarity_types, target_dir, num_folds, dsettype): aupr_df = pd.DataFrame() f1_df = pd.DataFrame() target_dir = create_directory(target_dir) + print(target_dir) for sim_type in similarity_types: - s_auc , s_aupr, s_f1 = get_performance_results(sim_type, target_dir, num_folds, dsettype) + s_auc, s_aupr, s_f1 = get_performance_results(sim_type, target_dir, num_folds, dsettype) auc_df = pd.concat([auc_df, s_auc], sort=True) aupr_df = pd.concat([aupr_df, s_aupr], sort=True) f1_df = pd.concat([f1_df, s_f1], sort=True)