Skip to content

Commit

Permalink
Add updates from Zach
Browse files Browse the repository at this point in the history
  • Loading branch information
zyliang2001 committed Jan 24, 2024
1 parent 2f6f7bf commit 786902b
Show file tree
Hide file tree
Showing 4 changed files with 842 additions and 347 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
# vary two parameters in a grid
### "sample_row_n"
VARY_PARAM_NAME = ["heritability", "n"]
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, "0.4": 0.4, "0.8": 0.8},
VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.4": 0.4, "0.8": 0.8},
"n": {"100": 100, "250": 250, "500": 500, "1000": 1000}}
# VARY_PARAM_VALS = {"heritability": {"0.1": 0.1, "0.2": 0.2, "0.4": 0.4, "0.8": 0.8},
# "n": {"100": 100, "250": 250, "500": 500, "1000": 1000}}

# # vary over n_estimators in RF model in models.py
# VARY_PARAM_NAME = "n_estimators"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from sklearn.ensemble import RandomForestRegressor
from feature_importance.util import ModelConfig, FIModelConfig
from feature_importance.scripts.competing_methods_local import tree_shap_local, permutation_local, lime_local, MDI_local_all_stumps, MDI_local_sub_stumps
from feature_importance.scripts.competing_methods_local import *
# N_ESTIMATORS=[50, 100, 500, 1000]
ESTIMATORS = [
[ModelConfig('RF', RandomForestRegressor, model_type='tree',
Expand All @@ -10,10 +10,18 @@
]

FI_ESTIMATORS = [
[FIModelConfig('MDI_all_stumps_with_raw', MDI_local_all_stumps, ascending = False, model_type='tree')],
[FIModelConfig('MDI_sub_stumps_with_raw', MDI_local_sub_stumps, ascending = False, model_type='tree')],
[FIModelConfig('MDI_all_stumps', MDI_local_all_stumps, ascending = False, model_type='tree')],
[FIModelConfig('MDI_sub_stumps', MDI_local_sub_stumps, ascending = False, model_type='tree')],
[FIModelConfig('MDI_all_stumps_without_raw', MDI_local_all_stumps, ascending = False, model_type='tree', other_params={"include_raw": False})],
[FIModelConfig('MDI_sub_stumps_without_raw', MDI_local_sub_stumps, ascending = False, model_type='tree', other_params={"include_raw": False})],
[FIModelConfig('LFI_sum_absolute_all_stumps', LFI_sum_absolute_all_stumps, model_type='tree')],
[FIModelConfig('LFI_absolute_sum_all_stumps', LFI_absolute_sum_all_stumps, model_type='tree')],
[FIModelConfig('LFI_sum_absolute_sub_stumps', LFI_sum_absolute_sub_stumps, model_type='tree')],
[FIModelConfig('LFI_absolute_sum_sub_stumps', LFI_absolute_sum_sub_stumps, model_type='tree')],
[FIModelConfig('LFI_sum_absolute_all_stumps_without_raw', LFI_sum_absolute_all_stumps, model_type='tree', other_params={"include_raw": False})],
[FIModelConfig('LFI_absolute_sum_all_stumps_without_raw', LFI_absolute_sum_all_stumps, model_type='tree', other_params={"include_raw": False})],
[FIModelConfig('LFI_sum_absolute_sub_stumps_without_raw', LFI_sum_absolute_sub_stumps, model_type='tree', other_params={"include_raw": False})],
[FIModelConfig('LFI_absolute_sum_sub_stumps_without_raw', LFI_absolute_sum_sub_stumps, model_type='tree', other_params={"include_raw": False})],
[FIModelConfig('TreeSHAP', tree_shap_local, model_type='tree')],
[FIModelConfig('LIME', lime_local, model_type='tree')],
]
Expand Down
Loading

0 comments on commit 786902b

Please sign in to comment.