Variable importance (X_imp)

from pyxla import X_imp
from pyxla.util import load_sample
from matplotlib import rc_file
rc_file('../../../../src/.matplotlibrc')
from matplotlib import rcParams
rcParams['figure.figsize'] = [2.9, 2.9]
%cd ../../..
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, suptitle=False)
plot.savefig('x-imp-nk-k1.pdf')
importance_ranks
corr_matrix, importance_ranks, plot = X_imp(nk_k2, binary=True, estimator='ridge', seed=42, suptitle=False)
plot.savefig('x-imp-nk-k2.pdf')
corr_matrix, importance_ranks, plot = X_imp(nk_k4, binary=True, estimator='ridge', seed=42, suptitle=False)
plot.savefig('x-imp-nk-k4.pdf')