Skip to content

Commit 7de1a94

Browse files
committed
update changes
1 parent c85983d commit 7de1a94

30 files changed

+26657
-26612
lines changed

feature_importance/01_ablation_regression_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
source activate mdi
77
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
8-
command="01_run_ablation_regression.py --nreps 1 --config mdi_local.real_data_regression --split_seed ${1} --ignore_cache --create_rmd --folder_name diabetes_final --fit_model True --positive_masking True --absolute_masking True --negative_masking True"
8+
command="01_run_ablation_regression.py --nreps 1 --config mdi_local.real_data_regression --split_seed ${1} --ignore_cache --create_rmd --folder_name diabetes_new_methods --fit_model True --positive_masking True --absolute_masking True --negative_masking True"
99

1010
# Execute the command
1111
python $command

feature_importance/01_ablation_script_regr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
slurm_script="01_ablation_regression_script_synthetic.sh"
3+
slurm_script="01_ablation_regression_script.sh"
44

55
for rep in {1..10}
66
do

feature_importance/01_auroc_regression_script_linear.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
source activate mdi
77
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
8-
command="01_run_auroc_synthetic.py --nreps 1 --config mdi_local.synthetic_data_linear --split_seed 0 --simulation_seed ${1} --ignore_cache --create_rmd --folder_name linear_synthetic_new --fit_model True"
8+
command="01_run_auroc_synthetic.py --nreps 1 --config mdi_local.synthetic_data_linear --split_seed 0 --simulation_seed ${1} --ignore_cache --create_rmd --folder_name linear_one_group_test_300_avg_leaf --fit_model True"
99

1010
# Execute the command
1111
python $command
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
#SBATCH --mail-user=zhongyuan_liang@berkeley.edu
3+
#SBATCH --mail-type=ALL
4+
#SBATCH --partition=yugroup
5+
6+
source activate mdi
7+
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
8+
command="01_run_auroc_synthetic.py --nreps 1 --config mdi_local.synthetic_data_linear2 --split_seed 0 --simulation_seed ${1} --ignore_cache --create_rmd --folder_name linear_one_group_2 --fit_model True"
9+
10+
# Execute the command
11+
python $command
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
#SBATCH --mail-user=zhongyuan_liang@berkeley.edu
3+
#SBATCH --mail-type=ALL
4+
#SBATCH --partition=yugroup
5+
6+
source activate mdi
7+
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
8+
command="01_run_auroc_synthetic.py --nreps 1 --config mdi_local.synthetic_data_linear_concept_shift --split_seed 0 --simulation_seed ${1} --ignore_cache --create_rmd --folder_name linear_two_groups_concept_shift_test_300 --fit_model True"
9+
10+
# Execute the command
11+
python $command
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
#SBATCH --mail-user=zhongyuan_liang@berkeley.edu
3+
#SBATCH --mail-type=ALL
4+
#SBATCH --partition=yugroup
5+
6+
source activate mdi
7+
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
8+
command="01_run_auroc_synthetic.py --nreps 1 --config mdi_local.synthetic_data_linear_concept_shift2 --split_seed 0 --simulation_seed ${1} --ignore_cache --create_rmd --folder_name linear_two_groups_concept_shift_2 --fit_model True"
9+
10+
# Execute the command
11+
python $command

feature_importance/01_auroc_regression_script_lss.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
source activate mdi
77
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
8-
command="01_run_auroc_synthetic.py --nreps 1 --config mdi_local.synthetic_data_lss --split_seed ${1} --ignore_cache --create_rmd --folder_name lss_synthetic --fit_model True"
8+
command="01_run_auroc_synthetic_lss.py --nreps 1 --config mdi_local.synthetic_data_lss --split_seed 0 --simulation_seed ${1} --ignore_cache --create_rmd --folder_name lss_one_group_test_300_avg_leaf --fit_model True"
99

1010
# Execute the command
1111
python $command

feature_importance/01_auroc_script_regr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
slurm_script="01_auroc_regression_script_linear.sh"
3+
slurm_script="01_auroc_regression_script_lss.sh" #"01_auroc_regression_script_linear_concept_shift.sh"
44

5-
for rep in {1..3}
5+
for rep in {1..10}
66
do
77
sbatch $slurm_script $rep # Submit SLURM job using the specified script
88
sleep 2

feature_importance/01_run_ablation_regression.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,19 @@ def compare_estimators(estimators: List[ModelConfig],
289289
mode.append("positive")
290290
if args.negative_masking:
291291
mode.append("negative")
292+
293+
if loaded_model is not None:
294+
y_train_pred = loaded_model.predict(X_train)
295+
else:
296+
y_train_pred = None
292297

293298
for m in mode:
294299
start = time.time()
295300
print(f"Compute feature importance")
296301
# Compute feature importance
297302
local_fi_score_train, local_fi_score_train_subset, local_fi_score_test, local_fi_score_test_subset = fi_est.cls(X_train=X_train, y_train=y_train, X_train_subset = X_train_subset, y_train_subset=y_train_subset,
298303
X_test=X_test, y_test=y_test, X_test_subset=X_test_subset, y_test_subset=y_test_subset,
299-
fit=loaded_model, mode=m)
304+
fit=loaded_model, mode=m, y_train_pred=y_train_pred)
300305
if fi_est.name.startswith("Local_MDI+"):
301306
local_fi_score_train_subset = local_fi_score_train[indices_train]
302307

0 commit comments

Comments
 (0)