From f6346bb39620e4c1393ef73b738d700dfb3d0e47 Mon Sep 17 00:00:00 2001 From: joaquintb Date: Fri, 28 Jun 2024 15:05:10 +0200 Subject: [PATCH] Access to attribute names updated --- .gitignore | 4 ++-- explainability/compute_shap_inter_vals.py | 2 +- explainability/compute_shap_vals.py | 2 +- explainability/fit_final_models.py | 2 +- explainability/shap_plots.ipynb | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 643c746..e587f53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -gen_train_data/input/ -gen_train_data/output/ +gen_train_data/output/post +gen_train_data/output/pre EDA/input/17_abril.sav EDA/output/datasets \ No newline at end of file diff --git a/explainability/compute_shap_inter_vals.py b/explainability/compute_shap_inter_vals.py index f888978..36fe890 100644 --- a/explainability/compute_shap_inter_vals.py +++ b/explainability/compute_shap_inter_vals.py @@ -36,7 +36,7 @@ if __name__ == "__main__": # Setup # -------------------------------------------------------------------------------------------------------- # Retrieve attribute names in order - attribute_names = list(np.load('../gen_train_data/output/attributes.npy', allow_pickle=True)) + attribute_names = list(np.load('../EDA/output/feature_names/feature_names.npy', allow_pickle=True)) # Reading data data_dic = read_test_data(attribute_names) method_names = { diff --git a/explainability/compute_shap_vals.py b/explainability/compute_shap_vals.py index f187ca2..c34b8ee 100644 --- a/explainability/compute_shap_vals.py +++ b/explainability/compute_shap_vals.py @@ -36,7 +36,7 @@ if __name__ == "__main__": # Setup # -------------------------------------------------------------------------------------------------------- # Retrieve attribute names in order - attribute_names = list(np.load('../gen_train_data/output/attributes.npy', allow_pickle=True)) + attribute_names = list(np.load('../EDA/output/feature_names/feature_names.npy', allow_pickle=True)) # Reading data data_dic = read_test_data(attribute_names) method_names = { diff --git a/explainability/fit_final_models.py b/explainability/fit_final_models.py index 528395e..39206d4 100644 --- a/explainability/fit_final_models.py +++ b/explainability/fit_final_models.py @@ -111,7 +111,7 @@ if __name__ == "__main__": # Setup # -------------------------------------------------------------------------------------------------------- # Retrieve attribute names in order - attribute_names = list(np.load('../gen_train_data/output/attributes.npy', allow_pickle=True)) + attribute_names = list(np.load('../EDA/output/feature_names/feature_names.npy', allow_pickle=True)) # Reading data data_dic = read_training_data(attribute_names) method_names = { diff --git a/explainability/shap_plots.ipynb b/explainability/shap_plots.ipynb index b9f1f92..91ec6ed 100644 --- a/explainability/shap_plots.ipynb +++ b/explainability/shap_plots.ipynb @@ -35,7 +35,7 @@ "outputs": [], "source": [ "# Retrieve attribute names in order\n", - "attribute_names = list(np.load('../gen_train_data/output/attributes.npy', allow_pickle=True))\n", + "attribute_names = attribute_names = list(np.load('../EDA/output/feature_names/feature_names.npy', allow_pickle=True))\n", "\n", "# Load test data\n", "X_test_pre = np.load('../gen_train_data/output/pre/X_test_pre.npy', allow_pickle=True)\n", @@ -71,8 +71,8 @@ " \"UNDER\": \"XGB\"\n", "}\n", "\n", - "soc_var_names = np.load('../EDA/output/soc_vars_names.npy', allow_pickle=True)\n", - "ind_var_names = np.load('../EDA/output/ind_vars_names.npy', allow_pickle=True)" + "soc_var_names = np.load('../EDA/output/feature_names/soc_vars_names.npy', allow_pickle=True)\n", + "ind_var_names = np.load('../EDA/output/feature_names/ind_vars_names.npy', allow_pickle=True)" ] }, { -- 2.24.1