def PlotObsPred( df, dataFile = None, E = None, Tp = None, block = True ): '''Plot observations and predictions''' # stats: {'MAE': 0., 'RMSE': 0., 'rho': 0. } stats = pyBindEDM.ComputeError( df['Observations'], df['Predictions' ] ) title = dataFile + "\nE=" + str(E) + " Tp=" + str(Tp) +\ " ρ=" + str( round( stats['rho'], 2 ) ) +\ " RMSE=" + str( round( stats['RMSE'], 2 ) ) time_col = df.columns[0] df.plot( time_col, ['Observations', 'Predictions'], title = title, linewidth = 3 ) show( block = block )
def PlotObsPred(df, dataFile=None, E=None, Tp=None, block=True): '''Plot observations and predictions''' # stats: {'MAE': 0., 'RMSE': 0., 'rho': 0. } stats = pyBindEDM.ComputeError(df['Observations'].tolist(), df['Predictions'].tolist()) title = dataFile + "\nE=" + str(E) + " Tp=" + str(Tp) +\ " ρ=" + str( round( stats['rho'], 2 ) ) +\ " RMSE=" + str( round( stats['RMSE'], 2 ) ) if "time" in df.columns: time_col = "time" elif "Time" in df.columns: time_col = "Time" else: raise RuntimeError("PlotObsPred() Time column not found.") df.plot(time_col, ['Observations', 'Predictions'], title=title, linewidth=3) show(block=block)
def ComputeError( obs, pred ): '''Pearson rho, RMSE, MAE.''' D = pyBindEDM.ComputeError( obs, pred ) return D