Variable importance (X_imp)¶
from pyxla import X_imp
from pyxla.util import load_sample
%cd ../../..
/home/toni/Projects/pyxla-wg/docs
nk_k1 = load_sample('nk_n14_k1', exclude='D') # exclude huge D file
nk_k2 = load_sample('nk_n14_k2', exclude='D') # exclude huge D file
nk_k4 = load_sample('nk_n14_k4', exclude='D') # exclude huge D file
corr_matrix, importance_ranks, plot = X_imp(nk_k1, binary=True, estimator='ridge', seed=42)
importance_ranks
{'f0': X importance std rank
0 x14 0.0 0.0 1
1 x13 0.0 0.0 2
2 x12 0.0 0.0 3
3 x11 0.0 0.0 4
4 x10 0.0 0.0 5
5 x9 0.0 0.0 6
6 x8 0.0 0.0 7
7 x7 0.0 0.0 8
8 x6 0.0 0.0 9
9 x5 0.0 0.0 10
10 x4 0.0 0.0 11
11 x3 0.0 0.0 12
12 x2 0.0 0.0 13
13 x1 0.0 0.0 14}
corr_matrix, importance_ranks, plot = X_imp(nk_k2, binary=True, estimator='ridge', seed=42)
corr_matrix, importance_ranks, plot = X_imp(nk_k4, binary=True, estimator='ridge', seed=42)