<jupyter_start><jupyter_text>Definitions. Fill in your own values here. If you used all default values for launching the search, only need to change exp_key<jupyter_code>result_db_name = 'rllab'
exp_key = 'rossler-swimmer-hyper2'
host = 'localhost'
port = 1234<jupyter_output><empty_output><jupyter_text>Connect to database (make sure mongodb is running)<jupyter_code>client = MongoClient(host, port)
db = client[result_db_name]
jobs = db.jobs<jupyter_output><empty_output><jupyter_text>Retrieve and format results<jupyter_code>df = pd.DataFrame(list(jobs.find({'exp_key':exp_key})))
param_dicts = []
score_curves = []
for i in range(df.shape[0]):
    res = df.result.iat[i]
    if res['status'] == 'ok':
        resdict = res['params']
        resdict['score'] = -df.result[i]['loss']
        resdict['result_index'] = i
        score_curves.append(res['scores']) # this only works if your function to process results returns the learning curve
        param_dicts.append(resdict)
param_df = pd.DataFrame(param_dicts)<jupyter_output><empty_output><jupyter_text>Results table<jupyter_code>sorted_results = param_df.sort_values(by="score")
sorted_results<jupyter_output><empty_output><jupyter_text>Learning curve of best parameter set<jupyter_code>best_score_index = param_df.score.values.argmax()
plt.figure()
plt.plot(score_curves[best_score_index])
plt.xlabel('Learning algo iter')
plt.ylabel('Average return')
plt.figure()
plt.subplot(1,2,1)
plt.plot(sorted_results.best_frac, 'o')
plt.plot(sorted_results.init_std, 'o')

plt.subplot(1,2,2)
plt.plot(sorted_results.extra_std, 'o')<jupyter_output><empty_output><jupyter_text>Hyperopt score progression<jupyter_code>plt.figure()
plt.plot(param_df.score.rolling(window=2).max())
plt.title('Rolling max of hyperopt score progression')
plt.xlabel('Hyperopt iter')
plt.ylabel('Score')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13326168726491133, 'fraction_numerical': 0.006985491671144546, 'mean_word_length': 7.202643171806168, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '289724', 'license': 'MIT', 'n_tokens_mistral': 703, 'n_tokens_neox': 664, 'n_words': 117, 'path': 'contrib/rllab_hyperopt/visualize_hyperopt_results.ipynb', 'repo_name': 'sytham/rnn-benchmark', 'size': '1861'}