You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
event_totals= {} # empty dict to store totals of events for each strategy
28
29
# initialise dataframes
29
30
forindex_strategyinrange(len(strategies)):
30
-
Output_collection[strategies[index_strategy]] =pd.DataFrame(columns= ['Alpha', 'Beta','MAPprobability', 'Precision']) # empty Dataframe to input data into
31
+
Output_collection[strategies[index_strategy]] =pd.DataFrame(columns= ['Alpha', 'Beta','MAPprobability', 'Precision','Alpha_interpolated', 'Beta_interpolated','MAPprobability_interpolated', 'Precision_interpolated']) # empty Dataframe to input data into
31
32
event_totals[strategies[index_strategy]] = {}; # create empty dict for this strategy
# store results - dynamically-defined dataframe...
54
-
new_row= {'Alpha':Alpha, 'Beta':Beta, 'MAPprobability':MAPprobability, 'Precision':precision} # create new row for dataframe as a dict
55
-
new_df=pd.DataFrame([new_row]) # have to convert to dataframe to use concat!!
65
+
new_df=pd.DataFrame([new_row_of_data]) # have to convert to dataframe to use concat!!
56
66
Output_collection[strategies[index_strategy]] =pd.concat([Output_collection[strategies[index_strategy]], new_df], ignore_index=True) # add new row to dataframe
57
-
67
+
68
+
58
69
#%% plot results
59
70
no_Trials=np.size(TestData.TrialIndex)
60
71
61
-
# plotting time series of MAPprobability
72
+
# plotting time series of MAPprobability for Rule Strategies
62
73
plt.figure(figsize=(10, 5))
63
74
plt.plot(Output_collection['go_left'].MAPprobability, linewidth=0.75) # plots the time series
0 commit comments