ml-solarwind / plot_importances.py
plot_importances.py
Raw
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 16 15:13:56 2020

@author: baum_c4
"""

import numpy as np
import pandas as pd

import pickle
import matplotlib.colors as mcol
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib


with open('plot_importances.pickle', 'rb') as f:
    impis=pickle.load( f)
impstd=np.std(impis,axis=0)
impmean=np.mean(impis,axis=0)
sum_mean=np.sum(impmean)
font = { 'size'   : 12,'weight' : 'normal',}

matplotlib.rc('font', **font)


f,ax = plt.subplots(1,1,figsize=(9*0.39,8*0.39))

label=np.array(['r$_x$','r$_y$','r$_z$','v$_x$','v$_y$','v$_z$','DST'])


c=ax.boxplot(impis,showmeans='True',meanline='True',labels=label) 
#ax[0].set_xlabel('ACE position in X [Re]')
ax.set_ylabel('feature importance [min]')
ax.set_title('10-fold drop column FI')

ax.grid(True)
plt.tight_layout()
plt.savefig('plot_importance.pdf',bbox_inches='tight')
plt.show()