Skip to content

Commit

Permalink
update changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zyliang2001 committed Aug 28, 2024
1 parent c85983d commit 7de1a94
Show file tree
Hide file tree
Showing 30 changed files with 26,657 additions and 26,612 deletions.
2 changes: 1 addition & 1 deletion feature_importance/01_ablation_regression_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

source activate mdi
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
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"
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"

# Execute the command
python $command
2 changes: 1 addition & 1 deletion feature_importance/01_ablation_script_regr.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

slurm_script="01_ablation_regression_script_synthetic.sh"
slurm_script="01_ablation_regression_script.sh"

for rep in {1..10}
do
Expand Down
2 changes: 1 addition & 1 deletion feature_importance/01_auroc_regression_script_linear.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

source activate mdi
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
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"
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"

# Execute the command
python $command
11 changes: 11 additions & 0 deletions feature_importance/01_auroc_regression_script_linear2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=ALL
#SBATCH --partition=yugroup

source activate mdi
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
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"

# Execute the command
python $command
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=ALL
#SBATCH --partition=yugroup

source activate mdi
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
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"

# Execute the command
python $command
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=ALL
#SBATCH --partition=yugroup

source activate mdi
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
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"

# Execute the command
python $command
2 changes: 1 addition & 1 deletion feature_importance/01_auroc_regression_script_lss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

source activate mdi
# Need to specify --result_name --ablate_features(default all features) --fitted(default not fitted)
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"
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"

# Execute the command
python $command
4 changes: 2 additions & 2 deletions feature_importance/01_auroc_script_regr.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

slurm_script="01_auroc_regression_script_linear.sh"
slurm_script="01_auroc_regression_script_lss.sh" #"01_auroc_regression_script_linear_concept_shift.sh"

for rep in {1..3}
for rep in {1..10}
do
sbatch $slurm_script $rep # Submit SLURM job using the specified script
sleep 2
Expand Down
7 changes: 6 additions & 1 deletion feature_importance/01_run_ablation_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,19 @@ def compare_estimators(estimators: List[ModelConfig],
mode.append("positive")
if args.negative_masking:
mode.append("negative")

if loaded_model is not None:
y_train_pred = loaded_model.predict(X_train)
else:
y_train_pred = None

for m in mode:
start = time.time()
print(f"Compute feature importance")
# Compute feature importance
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,
X_test=X_test, y_test=y_test, X_test_subset=X_test_subset, y_test_subset=y_test_subset,
fit=loaded_model, mode=m)
fit=loaded_model, mode=m, y_train_pred=y_train_pred)
if fi_est.name.startswith("Local_MDI+"):
local_fi_score_train_subset = local_fi_score_train[indices_train]

Expand Down
Loading

0 comments on commit 7de1a94

Please sign in to comment.