-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelsa_2_feature_importance.py
30 lines (23 loc) · 1.1 KB
/
elsa_2_feature_importance.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'''
This script computes the feature importances and creates a figure.
The compute=False argument allows to read the previously computed results.
The Integrated Gradient method from Captum is applied at each timestep and
for each event, for this reason, the computation is costly and may have to run
overnight.
'''
from figures.figure_feature_importance import Figure_feature_importance
plot_models = ['deephit',
'transformer'
]
ffi_captum = Figure_feature_importance(compute=True,
size=10,
mode='captum',
plot_models=plot_models,
title='Integrated gradients on a sample of 10 patients')
ffi_captum.run(n_plotted=7)
ffi_shap = Figure_feature_importance(compute=True,
size=10,
mode='shap',
plot_models=plot_models,
title='SHAP values on a sample of 10 patients')
ffi_shap.run(n_plotted=7)