ml-solarwind / plot_realtime.py
plot_realtime.py
Raw
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 16 11:22:20 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_RMSE_realtime.pickle', 'rb') as f:
    RT_RMSES=pickle.load( f)

                  
with open('plot_R2_realtime.pickle', 'rb') as f:
    R2scopt,R2gb,R2flat,R2vec,R2linreg=pickle.load(f)
    
font = { 'size'   : 11,'weight' : 'normal',}

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

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

label=['x','RFreg','GBreg','Copl.','flat','linReg']
x = np.arange(len(label)-1) 

width=0.3
c=ax.bar(x,RT_RMSES,width) 
#ax[0].set_xlabel('ACE position in X [Re]')
ax.set_ylabel('prediction RMSE [min]')
ax.set_title('Realtime scenario')
ax.set_xticklabels(label)
#ax.grid(True)
plt.tight_layout()
plt.savefig('plot_realtime_rmse.pdf',bbox_inches='tight')
plt.show()



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

label=['x','RFreg','GBreg','Copl.','flat','linReg']
x = np.arange(len(label)-1) 

width=0.3
c=ax.bar(x,[R2scopt,R2gb,R2linreg,R2flat,R2linreg],width) 
#ax[0].set_xlabel('ACE position in X [Re]')
ax.set_ylabel('R$^2$')
ax.set_title('Realtime scenario')
ax.set_xticklabels(label)
ax.set_ylim(0.,1.)
#ax.grid(True)
plt.tight_layout()
plt.savefig('plot_realtime_r2.pdf',bbox_inches='tight')
plt.show()