<jupyter_start><jupyter_text>fig.savefig('scatter_auc_rows.png')  Feature importance results<jupyter_code>results_hyper_dt = pd.DataFrame()
results_hypo_dt  = pd.DataFrame()
results_severe_dt = pd.DataFrame()

for filepath in files:
    num_rows = pd.read_csv('data/' + filepath, header=0, skiprows=1, delimiter="\t", index_col=0,
                                       usecols=list(range(0, 9)), decimal=",").shape[0]
    trees = Model('data/' + filepath)
    trees.fit()
    results_hyper_dt = pd.concat([results_hyper_dt, trees._hyper_dt.feature_importances])
    results_hypo_dt = pd.concat([results_hypo_dt, trees._hypo_dt.feature_importances])
    results_severe_dt = pd.concat([results_severe_dt, trees._severe_dt.feature_importances])
    
results_hyper_dt = results_hyper_dt.mean()
results_hypo_dt = results_hypo_dt.mean()
results_severe_dt = results_severe_dt.mean()
print(results_hyper_dt)     
results_hyper_dt.to_csv('results_hyper_dt.csv')
print(results_hypo_dt)   
results_hypo_dt.to_csv('results_hypo_dt.csv')
print(results_severe_dt)   
results_severe_dt.to_csv('results_severe_dt.csv')
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams.update(pd.tools.plotting.mpl_stylesheet)
width = 0.2
ind = np.arange(len(results_hyper_dt))[::-1]
fig, ax = plt.subplots(figsize=(15, 20), dpi=70)
ax.barh(ind-width, results_hyper_dt, width, color='#348ABD', label='Hyperglycemia')
ax.barh(ind , results_hypo_dt, width,  color='#7A68A6',  label='Hypoglycemia')
ax.barh(ind+width, results_severe_dt, width,  color='#A60631', label='Severe Hyperglycemia')
ax.set(yticks=ind + width, yticklabels=results_hyper_dt.index, ylim=[3*width - 1, len(results_hyper_dt)])
ax.legend()
plt.show()
fig.savefig('feature_importance_plot.png')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13600451467268623, 'fraction_numerical': 0.01636568848758465, 'mean_word_length': 6.236734693877551, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '451894', 'license': 'MIT', 'n_tokens_mistral': 706, 'n_tokens_neox': 657, 'n_words': 91, 'path': 'notebooks/14.model_evaluation_2.ipynb', 'repo_name': 'franloza/Glycemic-Patterns', 'size': '1772'}