Skip to content

Commit

Permalink
Fix one more
Browse files Browse the repository at this point in the history
  • Loading branch information
zyliang2001 committed Mar 19, 2024
1 parent 96a0982 commit 377028f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion feature_importance/01_ablation_classification_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
seed=$(shuf -i 1-10000 -n 1)

# Replace XXX with the generated seed
command="01_run_ablation_classification.py --nreps 1 --config mdi_local.real_data_classification --split_seed $seed --ignore_cache --create_rmd --result_name try2.0"
command="01_run_ablation_classification.py --nreps 1 --config mdi_local.real_data_classification --split_seed $seed --ignore_cache --create_rmd --result_name Diabetes_classification_parallel"

# Execute the command
python $command
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 @@ -4,7 +4,7 @@
seed=$(shuf -i 1-10000 -n 1)

# Replace XXX with the generated seed
command="01_run_ablation_regression.py --nreps 1 --config mdi_local.real_data_regression --split_seed $seed --ignore_cache --create_rmd --result_name try2.0"
command="01_run_ablation_regression.py --nreps 1 --config mdi_local.real_data_regression --split_seed $seed --ignore_cache --create_rmd --result_name Diabetes_regression_parallel"

# Execute the command
python $command
4 changes: 3 additions & 1 deletion feature_importance/01_ablation_script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=ALL

# Define the SLURM submission script name
slurm_script="{slurm_submission_script}.sh" # Replace {slurm_submission_script} with your actual script name
slurm_script="01_ablation_regression_script.sh" # Replace {slurm_submission_script} with your actual script name

# Loop to submit SLURM job 10 times
for rep in {1..10}
Expand Down
1 change: 1 addition & 0 deletions feature_importance/01_run_ablation_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def compare_estimators(estimators: List[ModelConfig],
ablation_results_list[i] += mean_squared_error(y_test, est.predict(ablation_X_test))
ablation_results_list_r2[i] += r2_score(y_test, est.predict(ablation_X_test))
ablation_results_list = [x / len(seeds) for x in ablation_results_list]
ablation_results_list_r2 = [x / len(seeds) for x in ablation_results_list_r2]
for i in range(X_test.shape[1]):
metric_results[f'MSE_after_ablation_{i+1}'] = ablation_results_list[i]
metric_results[f'R_2_after_ablation_{i+1}'] = ablation_results_list_r2[i]
Expand Down

0 comments on commit 377028f

Please sign in to comment.