<jupyter_start><jupyter_text>APPEND DATA TO BEST_RESULTS_FILE<jupyter_code>import csv
import pandas

# with open('best_results_train.csv', 'wb') as csvfile:
#     spamwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
#     spamwriter.writerow(['total', 'agg', 'sel', 'cond', 'group', 'epoch_num', 'toy', 'changes_made'])
# with open('best_results_dev.csv', 'wb') as csvfile:
#     new_writer = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
#     new_writer.writerow(['total', 'agg', 'sel', 'cond', 'group', 'epoch_num', 'toy', 'changes_made'])


# Train_Data
to_write = np.append(np.nanmax(my_data, axis=0), [300, True])
# Get Data
to_app = {}
names = ['total', 'agg', 'sel', 'cond', 'group', 'epoch_num', 'toy', 'changes_made']
for i, item in enumerate(to_write):
    to_app[names[i]] = item
to_app['toy'] = to_app['toy'] == 1
to_app['changes_made'] = 'moving agg accuracy back to before'
# Convert to DataFrame - one row
to_add = pandas.DataFrame(columns=names)
to_add.loc[0] = to_app

# Append to CSV
with open('best_results_train.csv', 'a') as csvfile:
    spamwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
    spamwriter.writerow(to_add.loc[0])

# Dev_data
to_write = np.append(np.nanmax(dev_data, axis=0), [300, True])
# Get Data
to_app = {}
names = ['total', 'agg', 'sel', 'cond', 'group', 'epoch_num', 'toy', 'changes_made']
for i, item in enumerate(to_write):
    to_app[names[i]] = item
to_app['toy'] = to_app['toy'] == 1
to_app['changes_made'] = 'moving agg accuracy back to before'
# Convert to DataFrame - one row
to_add = pandas.DataFrame(columns=names)
to_add.loc[0] = to_app

# Append to CSV
with open('best_results_dev.csv', 'a') as csvfile:
    spamwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
    spamwriter.writerow(to_add.loc[0])<jupyter_output><empty_output><jupyter_text>See Total History of Changes<jupyter_code>train_hist = np.genfromtxt('best_results_train.csv', delimiter=' ',usecols=np.arange(0,5), dtype=float)
dev_hist = np.genfromtxt('best_results_dev.csv', delimiter=' ', usecols = np.arange(0, 5), dtype=float)
x = range(len(train_hist) - 1) 

plt.plot(x,train_hist[1:,1],'--o', label='Agg accuracy' )
plt.plot(x,train_hist[1:,2], '--o', label='Sel accuracy')
plt.plot(x,train_hist[1:,3], '--o',label='Cond accuracy')
plt.plot(x,train_hist[1:,4], '--o',label='Group accuracy')
plt.plot(x, train_hist[1:,0], '--o',label = 'Total accuracy')

plt.xlabel('Attempt')
plt.ylabel('Accuracy')
plt.title('Training Accuracy')
plt.legend(loc=9, bbox_to_anchor=(1.3, 0.5))
#pylab.legend(loc=9, bbox_to_anchor=(0.5, -0.1))
plt.show()
dev_hist[1:,2] # SELECTION ACCURACY
dev_hist[1:,1] # AGGREGATION ACCURACY<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19215686274509805, 'fraction_numerical': 0.015329768270944741, 'mean_word_length': 6.462765957446808, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '46844', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1107, 'n_words': 212, 'path': 'Visualize Results.ipynb', 'repo_name': 'shanelleroman/seq2sql', 'size': '2805'}