-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pushing files from older version of code
- Loading branch information
1 parent
0a7508a
commit 59a45b3
Showing
32 changed files
with
2,447 additions
and
12,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
#!/bin/bash | ||
#SBATCH [email protected] | ||
#SBATCH --mail-type=ALL | ||
#SBATCH --partition=yugroup | ||
|
||
source activate mdi | ||
command="run_importance_local_sims.py --nreps 1 --config mdi_local.real_x_sim_y --split_seed 1 --ignore_cache --create_rmd --result_name feature_ranking" | ||
command="ranking_importance_local_sims.py --nreps 1 --config mdi_local.real_x_sim_y.diabetes-classification.lss-model --split_seed ${1} --ignore_cache --create_rmd --result_name diabetes-class-lss" | ||
|
||
# Execute the command | ||
python $command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
slurm_script="feature_ranking.sh" | ||
|
||
for rep in {1..10} | ||
do | ||
sbatch $slurm_script $rep # Submit SLURM job using the specified script | ||
done |
24 changes: 24 additions & 0 deletions
24
...e/fi_config/mdi_local/real_x_sim_y/diabetes-classification/hierarchical-polynomial/dgp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sys | ||
sys.path.append("../..") | ||
from feature_importance.scripts.simulations_util import * | ||
|
||
|
||
X_DGP = sample_real_X | ||
X_PARAMS_DICT = { | ||
"fpath": "../data/classification_data/Diabetes/X_diabetes.csv", | ||
"sample_row_n": 442 | ||
} | ||
Y_DGP = hierarchical_poly | ||
Y_PARAMS_DICT = { | ||
"beta": 1, | ||
"sigma": None, | ||
"heritability": 0.4, | ||
"m": 3, | ||
"r": 2 | ||
} | ||
|
||
VARY_PARAM_NAME = ["heritability", "sample_row_n"] | ||
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, | ||
"0.4": 0.4, "0.8": 0.8}, | ||
"sample_row_n": {"100": 100, "200": 200, | ||
"400": 400, "600": 600}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...e_importance/fi_config/mdi_local/real_x_sim_y/diabetes-classification/logistic-lss/dgp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import sys | ||
sys.path.append("../..") | ||
from feature_importance.scripts.simulations_util import * | ||
|
||
|
||
X_DGP = sample_real_X | ||
X_PARAMS_DICT = { | ||
"fpath": "../data/classification_data/Diabetes/X_diabetes.csv", | ||
"sample_row_n": 768 | ||
} | ||
|
||
Y_DGP = logistic_partial_linear_lss_model | ||
Y_PARAMS_DICT = { | ||
"s":1, | ||
"m":3, | ||
"r":2, | ||
"tau":0, | ||
"beta": 1, | ||
"heritability": 0.4 | ||
} | ||
VARY_PARAM_NAME = ["heritability", "sample_row_n"] | ||
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, | ||
"0.4": 0.4, "0.8": 0.8}, | ||
"sample_row_n": {"100": 100, "200": 200, | ||
"400": 400, "600": 600}} | ||
|
25 changes: 25 additions & 0 deletions
25
...mportance/fi_config/mdi_local/real_x_sim_y/diabetes-classification/logistic-lss/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import copy | ||
import numpy as np | ||
from feature_importance.util import ModelConfig, FIModelConfig | ||
from sklearn.ensemble import RandomForestClassifier | ||
from imodels.importance.rf_plus import RandomForestPlusClassifier | ||
from feature_importance.scripts.competing_methods_local import * | ||
|
||
|
||
|
||
ESTIMATORS = [ | ||
[ModelConfig('RF', RandomForestClassifier, model_type='tree', | ||
other_params={'n_estimators': 100, 'min_samples_leaf': 1, 'max_features': 'sqrt', 'random_state': 42})], | ||
[ModelConfig('RF_plus', RandomForestPlusClassifier, model_type='t_plus', | ||
other_params={'rf_model': RandomForestClassifier(n_estimators=100, min_samples_leaf=1, max_features='sqrt', random_state=42)})] | ||
] | ||
|
||
FI_ESTIMATORS = [ | ||
[FIModelConfig('LFI_with_raw_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('MDI_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"include_raw": False, "cv_ridge": 0, "calc_loo_coef":False, "sample_split":"inbag"})], | ||
[FIModelConfig('LFI_with_raw_OOB_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"sample_split":"oob", "fit_on":"test", "calc_loo_coef":False})], | ||
[FIModelConfig('TreeSHAP_RF', tree_shap_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('LFI_with_raw_RF_plus', LFI_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('Kernel_SHAP_RF_plus', kernel_shap_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('LIME_RF_plus', lime_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
] |
23 changes: 23 additions & 0 deletions
23
...importance/fi_config/mdi_local/real_x_sim_y/diabetes-classification/logistic-model/dgp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sys | ||
sys.path.append("../..") | ||
from feature_importance.scripts.simulations_util import * | ||
|
||
|
||
X_DGP = sample_real_X | ||
X_PARAMS_DICT = { | ||
"fpath": "../data/classification_data/Diabetes/X_diabetes.csv", | ||
"sample_row_n": 768 | ||
} | ||
|
||
Y_DGP = logistic_model | ||
Y_PARAMS_DICT = { | ||
"s": 4, | ||
"beta": 1, | ||
"heritability": 0.4 | ||
} | ||
|
||
VARY_PARAM_NAME = ["heritability", "sample_row_n"] | ||
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, | ||
"0.4": 0.4, "0.8": 0.8}, | ||
"sample_row_n": {"100": 100, "200": 200, | ||
"400": 400, "600": 600}} |
25 changes: 25 additions & 0 deletions
25
...ortance/fi_config/mdi_local/real_x_sim_y/diabetes-classification/logistic-model/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import copy | ||
import numpy as np | ||
from feature_importance.util import ModelConfig, FIModelConfig | ||
from sklearn.ensemble import RandomForestClassifier | ||
from imodels.importance.rf_plus import RandomForestPlusClassifier | ||
from feature_importance.scripts.competing_methods_local import * | ||
|
||
|
||
|
||
ESTIMATORS = [ | ||
[ModelConfig('RF', RandomForestClassifier, model_type='tree', | ||
other_params={'n_estimators': 100, 'min_samples_leaf': 1, 'max_features': 'sqrt', 'random_state': 42})], | ||
[ModelConfig('RF_plus', RandomForestPlusClassifier, model_type='t_plus', | ||
other_params={'rf_model': RandomForestClassifier(n_estimators=100, min_samples_leaf=1, max_features='sqrt', random_state=42)})] | ||
] | ||
|
||
FI_ESTIMATORS = [ | ||
[FIModelConfig('LFI_with_raw_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('MDI_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"include_raw": False, "cv_ridge": 0, "calc_loo_coef":False, "sample_split":"inbag"})], | ||
[FIModelConfig('LFI_with_raw_OOB_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"sample_split":"oob", "fit_on":"test", "calc_loo_coef":False})], | ||
[FIModelConfig('TreeSHAP_RF', tree_shap_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('LFI_with_raw_RF_plus', LFI_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('Kernel_SHAP_RF_plus', kernel_shap_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('LIME_RF_plus', lime_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
] |
26 changes: 26 additions & 0 deletions
26
feature_importance/fi_config/mdi_local/real_x_sim_y/diabetes-classification/lss-model/dgp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import sys | ||
sys.path.append("../..") | ||
from feature_importance.scripts.simulations_util import * | ||
|
||
X_DGP = sample_real_X | ||
X_PARAMS_DICT = { | ||
"fpath": "../data/classification_data/Diabetes/X_diabetes.csv", | ||
"sample_row_n": None | ||
} | ||
|
||
Y_DGP = lss_model | ||
|
||
Y_PARAMS_DICT = { | ||
"beta": 1, | ||
"sigma": None, | ||
"heritability": 0.4, | ||
"tau": 0, | ||
"m": 3, | ||
"r": 2 | ||
} | ||
|
||
VARY_PARAM_NAME = ["heritability", "sample_row_n"] | ||
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, | ||
"0.4": 0.4, "0.8": 0.8}, | ||
"sample_row_n": {"100": 100, "200": 200, | ||
"400": 400, "600": 600}} |
25 changes: 25 additions & 0 deletions
25
...e_importance/fi_config/mdi_local/real_x_sim_y/diabetes-classification/lss-model/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import copy | ||
import numpy as np | ||
from feature_importance.util import ModelConfig, FIModelConfig | ||
from sklearn.ensemble import RandomForestRegressor | ||
from imodels.importance.rf_plus import RandomForestPlusRegressor | ||
from feature_importance.scripts.competing_methods_local import * | ||
|
||
|
||
|
||
ESTIMATORS = [ | ||
[ModelConfig('RF', RandomForestRegressor, model_type='tree', | ||
other_params={'n_estimators': 100, 'min_samples_leaf': 1, 'max_features': 'sqrt', 'random_state': 42})], | ||
[ModelConfig('RF_plus', RandomForestPlusRegressor, model_type='t_plus', | ||
other_params={'rf_model': RandomForestRegressor(n_estimators=100, min_samples_leaf=1, max_features='sqrt', random_state=42)})] | ||
] | ||
|
||
FI_ESTIMATORS = [ | ||
[FIModelConfig('LFI_with_raw_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('MDI_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"include_raw": False, "cv_ridge": 0, "calc_loo_coef":False, "sample_split":"inbag"})], | ||
[FIModelConfig('LFI_with_raw_OOB_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"sample_split":"oob", "fit_on":"test", "calc_loo_coef":False})], | ||
[FIModelConfig('TreeSHAP_RF', tree_shap_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('LFI_with_raw_RF_plus', LFI_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('Kernel_SHAP_RF_plus', kernel_shap_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('LIME_RF_plus', lime_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
] |
24 changes: 24 additions & 0 deletions
24
...tance/fi_config/mdi_local/real_x_sim_y/diabetes-regression/hierarchical-polynomial/dgp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sys | ||
sys.path.append("../..") | ||
from feature_importance.scripts.simulations_util import * | ||
|
||
|
||
X_DGP = sample_real_X | ||
X_PARAMS_DICT = { | ||
"fpath": "../data/regression_data/Diabetes_regression/X_diabetes_regression.csv", | ||
"sample_row_n": 442 | ||
} | ||
Y_DGP = hierarchical_poly | ||
Y_PARAMS_DICT = { | ||
"beta": 1, | ||
"sigma": None, | ||
"heritability": 0.4, | ||
"m": 3, | ||
"r": 2 | ||
} | ||
|
||
VARY_PARAM_NAME = ["heritability", "sample_row_n"] | ||
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, | ||
"0.4": 0.4, "0.8": 0.8}, | ||
"sample_row_n": {"100": 100, "200": 200, | ||
"300": 300, "400": 400}} |
25 changes: 25 additions & 0 deletions
25
...ce/fi_config/mdi_local/real_x_sim_y/diabetes-regression/hierarchical-polynomial/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import copy | ||
import numpy as np | ||
from feature_importance.util import ModelConfig, FIModelConfig | ||
from sklearn.ensemble import RandomForestRegressor | ||
from imodels.importance.rf_plus import RandomForestPlusRegressor | ||
from feature_importance.scripts.competing_methods_local import * | ||
|
||
|
||
|
||
ESTIMATORS = [ | ||
[ModelConfig('RF', RandomForestRegressor, model_type='tree', | ||
other_params={'n_estimators': 100, 'min_samples_leaf': 1, 'max_features': 'sqrt', 'random_state': 42})], | ||
[ModelConfig('RF_plus', RandomForestPlusRegressor, model_type='t_plus', | ||
other_params={'rf_model': RandomForestRegressor(n_estimators=100, min_samples_leaf=1, max_features='sqrt', random_state=42)})] | ||
] | ||
|
||
FI_ESTIMATORS = [ | ||
[FIModelConfig('LFI_with_raw_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('MDI_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"include_raw": False, "cv_ridge": 0, "calc_loo_coef":False, "sample_split":"inbag"})], | ||
[FIModelConfig('LFI_with_raw_OOB_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"sample_split":"oob", "fit_on":"test", "calc_loo_coef":False})], | ||
[FIModelConfig('TreeSHAP_RF', tree_shap_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('LFI_with_raw_RF_plus', LFI_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('Kernel_SHAP_RF_plus', kernel_shap_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('LIME_RF_plus', lime_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
] |
24 changes: 24 additions & 0 deletions
24
feature_importance/fi_config/mdi_local/real_x_sim_y/diabetes-regression/linear-lss/dgp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sys | ||
sys.path.append("../..") | ||
from feature_importance.scripts.simulations_util import * | ||
|
||
|
||
X_DGP = sample_real_X | ||
X_PARAMS_DICT = { | ||
"fpath": "../data/regression_data/Diabetes_regression/X_diabetes_regression.csv", | ||
"sample_row_n": 442 | ||
} | ||
Y_DGP = hierarchical_poly | ||
Y_PARAMS_DICT = { | ||
"beta": 1, | ||
"sigma": None, | ||
"heritability": 0.4, | ||
"m": 3, | ||
"r": 2 | ||
} | ||
|
||
VARY_PARAM_NAME = ["heritability", "sample_row_n"] | ||
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, | ||
"0.4": 0.4, "0.8": 0.8}, | ||
"sample_row_n": {"100": 100, "200": 200, | ||
"300": 300, "400": 400}} |
25 changes: 25 additions & 0 deletions
25
feature_importance/fi_config/mdi_local/real_x_sim_y/diabetes-regression/linear-lss/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import copy | ||
import numpy as np | ||
from feature_importance.util import ModelConfig, FIModelConfig | ||
from sklearn.ensemble import RandomForestRegressor | ||
from imodels.importance.rf_plus import RandomForestPlusRegressor | ||
from feature_importance.scripts.competing_methods_local import * | ||
|
||
|
||
|
||
ESTIMATORS = [ | ||
[ModelConfig('RF', RandomForestRegressor, model_type='tree', | ||
other_params={'n_estimators': 100, 'min_samples_leaf': 1, 'max_features': 'sqrt', 'random_state': 42})], | ||
[ModelConfig('RF_plus', RandomForestPlusRegressor, model_type='t_plus', | ||
other_params={'rf_model': RandomForestRegressor(n_estimators=100, min_samples_leaf=1, max_features='sqrt', random_state=42)})] | ||
] | ||
|
||
FI_ESTIMATORS = [ | ||
[FIModelConfig('LFI_with_raw_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('MDI_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"include_raw": False, "cv_ridge": 0, "calc_loo_coef":False, "sample_split":"inbag"})], | ||
[FIModelConfig('LFI_with_raw_OOB_RF', LFI_evaluation_RF, model_type='tree', splitting_strategy = "train-test", other_params={"sample_split":"oob", "fit_on":"test", "calc_loo_coef":False})], | ||
[FIModelConfig('TreeSHAP_RF', tree_shap_evaluation_RF, model_type='tree', splitting_strategy = "train-test")], | ||
[FIModelConfig('LFI_with_raw_RF_plus', LFI_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('Kernel_SHAP_RF_plus', kernel_shap_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
[FIModelConfig('LIME_RF_plus', lime_evaluation_RF_plus, model_type='t_plus', splitting_strategy = "train-test")], | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.