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
Either download this .ipynb file and upload it to your Jupyter Notebook instance, or add the following at the end of the file for detailed analysis on how your model is performing:
importnumpyasnpx=all_completed_lapsy1=first_20_percent_completedy2=last_20_percent_completedvalues, counts=np.unique(y1.steps, return_counts=True)
first_20_plt=plt.vlines(values, 0, counts, color='C0', lw=6, label='First 20%')
values, counts=np.unique(y2.steps, return_counts=True)
last_20_plt=plt.vlines(values, 0, counts, color='red', lw=2, label='Last 20%')
plt.xlabel('Steps')
plt.ylabel('Occurences')
plt.title('Performance of Model Steps: First 20% vs Last 20%')
plt.legend(handles=[first_20_plt, last_20_plt])
plt.show()
print('A graph with red shifted more left than blue means the model has decreased the average number of steps over this training. This means the model is completing laps in less steps (good indicator that speed is increasing).')
# laptime trendfromscipyimportstatsjx=all_completed_laps['episode']
jy=all_completed_laps['time']
slope, intercept, r_value, p_value, std_err=stats.linregress(jx,jy)
line=slope*jx+interceptplt.plot(jx, line, 'r', label='y={:.2f}x+{:.2f}'.format(slope,intercept))
plt.scatter(jx,jy)
plt.legend(fontsize=9)
plt.xlabel('Episode')
plt.ylabel('Time')
plt.title('Lap Completion Time per Episode')
plt.show()
print("A line that is down to the right signifies a model that is improving it's lap time.")
print( 'Completed Laps:', len(all_completed_laps) )
print( 'Total Laps:', len(all_laps), '\n' )
print( 'Completion Rate:', len(all_completed_laps)/len(all_laps) )
print( 'Avg Time:', all_completed_laps['time'].mean(), '\n')
print( 'Completion Rate First 20%:', len(first_20_percent_completed)/len(first_20_percent_laps) )
print( 'Avg Time First 20%:', first_20_percent_completed['time'].mean(), '\n' )
print( 'Completion Rate Last 20%:', len(last_20_percent_completed)/len(last_20_percent_laps) )
print( 'Avg Time Last 20%:', last_20_percent_completed['time'].mean(), '\n' )
all_offtrack_laps=all_laps[all_laps['progress']!=100]
print('Stability Ratio:', len(all_completed_laps)/len(all_offtrack_laps))