<commit_before>import matplotlib.pyplot as plt

import common.file_utils as file_utils

GAME = 'space_invaders'
AGENT = 'SARSALambda'

stats = file_utils.load_stats('{}-{}.npz'.format(GAME, AGENT))

f, axarr = plt.subplots(2, sharex=True)

#rewards, = axarr[0].plot(stats['rewards'], label='reward')
avg_all, = axarr[0].plot(stats['avg_rewards_all'], label='all')
avg_partial, = axarr[0].plot(stats['avg_rewards_partial'], label='last 50')
legend1 = axarr[0].legend(bbox_to_anchor=(1, 1), loc=2, ncol=1,prop={'size':10})

#axarr[1].plot(stats['num_frames'], label='frames')
axarr[1].plot(stats['avg_frames_all'], label='all')
axarr[1].plot(stats['avg_frames_partial'], label='last 50')
legend2 = axarr[1].legend(bbox_to_anchor=(1, 1), loc=2, ncol=1,prop={'size':10})

f.savefig('stats/' + GAME + '_' + AGENT + '_rewards_frames.png', bbox_extra_artists=(legend1, legend2), bbox_inches='tight')

f, axarr = plt.subplots(2, sharex=True)

axarr[0].plot(stats['dict_sizes'])

axarr[1].plot(stats['min_weights'])
axarr[1].plot(stats['max_weights'])
axarr[1].plot(stats['avg_weights'])

f.savefig('stats/' + GAME + '_' + AGENT + '_weights.png', bbox_extra_artists=(legend1, legend2), bbox_inches='tight')<commit_msg>add features to plots' filename<commit_after>import matplotlib.pyplot as plt

import common.file_utils as file_utils

GAME = 'alien'
AGENT = 'SARSALambda'
FEATURES = 'basic'

stats = file_utils.load_stats('{}-{}-{}.npz'.format(GAME, AGENT, FEATURES))

f, axarr = plt.subplots(2, sharex=True)

#rewards, = axarr[0].plot(stats['rewards'], label='reward')
avg_all, = axarr[0].plot(stats['avg_rewards_all'], label='all')
avg_partial, = axarr[0].plot(stats['avg_rewards_partial'], label='last 50')
legend1 = axarr[0].legend(bbox_to_anchor=(1, 1), loc=2, ncol=1,prop={'size':10})

#axarr[1].plot(stats['num_frames'], label='frames')
axarr[1].plot(stats['avg_frames_all'], label='all')
axarr[1].plot(stats['avg_frames_partial'], label='last 50')
legend2 = axarr[1].legend(bbox_to_anchor=(1, 1), loc=2, ncol=1,prop={'size':10})

f.savefig('stats/' + GAME + '-' + AGENT + '-' + FEATURES + '-rewards_frames.png', bbox_extra_artists=(legend1, legend2), bbox_inches='tight')

f, axarr = plt.subplots(2, sharex=True)

axarr[0].plot(stats['dict_sizes'])

axarr[1].plot(stats['min_weights'])
axarr[1].plot(stats['max_weights'])
axarr[1].plot(stats['avg_weights'])

f.savefig('stats/' + GAME + '-' + AGENT + '-' + FEATURES + '-weights.png', bbox_extra_artists=(legend1, legend2), bbox_inches='tight')
{'fraction_non_alphanumeric': 0.21179302045728038, 'fraction_numerical': 0.02888086642599278, 'mean_word_length': 8.169117647058824, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1491502', 'n_tokens_mistral': 1032, 'n_tokens_neox': 1003, 'n_words': 144}