def display_results_HBF1_task2(): ## # experiment = '/multiple_S_task2_HP_hbf2' # path_to_experiments = './om_results_test_experiments'+experiment # hbf1_multiple_experiment_results = get_results_for_experiments(path_to_experiments,verbose=True) #mean_train_errors, std_train_errors, mean_test_errors_multiple, std_test_errors_multiple = get_error_stats(multiple_experiment_results) path_to_experiments = './om_results_test_experiments/multiple_S_task2_HP_hbf2' hbf1_multiple_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) #print hbf1_multiple_experiment_results # list_units, list_train_errors, list_test_errors = get_list_errors2( experiment_results=hbf1_multiple_experiment_results) #hbf1_list_units_single, hbf1_list_test_errors_single = get_list_errors(experiment_results=hbf1_single_experiment_results) # plt.figure(3) print 'hbf1_list_units_multiple: ', list_units print 'list_train_errors: ', list_train_errors print 'list_test_errors: ', list_test_errors krls.plot_errors(list_units, list_train_errors, label='HBF1 not shared HBF shape', markersize=3, colour='b') krls.plot_errors(list_units, list_test_errors, label='HBF1 not shared HBF shape', markersize=3, colour='r') plt.legend() plt.show()
def display4D_2(): list_units = [5*5, 10*5, 15*5] #list_units = 6*np.array([6,12,18]) nn1_list_test_errors = (8.971309392885537, 8.96969783241346, 8.971491006192313) krls.plot_errors(list_units, nn1_list_test_errors,label='NN train error', markersize=3, colour='b') #krls.plot_errors(list_units, nn1_list_test_errors,label='HBF1 test', markersize=3, colour='c') bt_multiple_experiment_results = (8.96799373626709, 8.967977523803711, 8.968118667602539) krls.plot_errors(list_units, bt_multiple_experiment_results,label='Binary Tree NN train error', markersize=3, colour='r') plt.legend() plt.show()
def display4D(): list_units = [5*5, 10*5, 15*5] #list_units = 6*np.array([6,12,18]) nn_list_train_errors = [0.107502, 0.0313551, 0.00974167] krls.plot_errors(list_units, nn_list_train_errors,label='NN train error', markersize=3, colour='b') #krls.plot_errors(list_units, nn1_list_test_errors,label='HBF1 test', markersize=3, colour='c') nn_list_train_errors = [0.047651, 0.012382, 0.008429] krls.plot_errors(list_units, nn_list_train_errors,label='Binary Tree NN train error', markersize=3, colour='r') plt.legend() plt.show()
def display8D(): list_units = [7, 22, 45] #list_units = 6*np.array([6,12,18]) nn1_list_test_errors = [0.951, 0.156, 0.0746] krls.plot_errors(list_units, nn1_list_test_errors,label='NN test error', markersize=3, colour='b') #krls.plot_errors(list_units, nn1_list_test_errors,label='HBF1 test', markersize=3, colour='c') bt_multiple_experiment_results = [0.2495, 0.0668, 0.01066] krls.plot_errors(list_units, bt_multiple_experiment_results,label='Binary Tree NN test error', markersize=3, colour='r') plt.legend() plt.show()
def display_results_multiple_vs_single(): ## experiment = '/multiple_S_dir' path_to_experiments = './om_results_test_experiments' + experiment multiple_experiment_results = get_results_for_experiments( path_to_experiments) mean_train_errors, std_train_errors, mean_test_errors_multiple, std_test_errors_multiple = get_error_stats( multiple_experiment_results) experiment = '/single_S_dir' path_to_experiments = './om_results_test_experiments' + experiment single_experiment_results = get_results_for_experiments( path_to_experiments) mean_train_errors, std_train_errors, mean_test_errors_single, std_test_errors_single = get_error_stats( single_experiment_results) print mean_test_errors_single print std_test_errors_single # list_units_multiple, list_test_errors_multiple = get_list_errors( experiment_results=multiple_experiment_results) list_units_single, list_test_errors_single = get_list_errors( experiment_results=single_experiment_results) # plt.figure(3) krls.plot_errors(list_units_multiple, list_test_errors_multiple, label='HBF1 Multiple Standard Deviations', markersize=3, colour='r') krls.plot_errors(list_units_single, list_test_errors_single, label='HBF1 Single Errors Standard Deviations', markersize=3, colour='b') krls.plot_errors_and_bars(list_units_multiple, mean_test_errors_multiple, std_test_errors_multiple, label='Multiple Errors', markersize=3, colour='b') krls.plot_errors_and_bars(list_units_single, mean_test_errors_single, std_test_errors_single, label='Single Errors', markersize=3, colour='r') # plt.legend() plt.show()
def display_this(): get_k = lambda a: 7*a + 4*3*2*a**2 shallow = lambda k: 4*k+k+k bt = lambda f: 2*f+f +2*f*(2*f)+ 2*(2*f) nn1_list_test_errors = (0.024345317618429937, 0.003073343364860556, 0.0017753394536080345, 0.0011256201563784277, 0.009532295960287112, 0.007766131572159345) bt_multiple_experiment_results = (0.0004508599522523582, 0.00015345749852713197, 1.3420359209703747e-05, 1.3420359209703747e-05, 1.3420359209703747e-05, 1.3420359209703747e-05) #list_units = [ bt()] list_units = [1,2, 3, 4, 5, 6] krls.plot_errors(list_units, nn1_list_test_errors,label='NN train error', markersize=3, colour='b') krls.plot_errors(list_units, bt_multiple_experiment_results,label='Binary Tree NN train error', markersize=3, colour='r') plt.legend() plt.show()
def display_results_HBF1_xsinglog1_x(): path_to_experiments = './om_results_test_experiments/task_27_july_NN1_depth_2_1000' nn1_multiple_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) path_to_experiments = './om_results_test_experiments/task_27_july_NN2_depth_2_1000' nn2_multiple_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) path_to_experiments = './om_results_test_experiments/task_27_july_NN3_depth_2_1000' nn3_multiple_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) # nn1_list_units, nn1_list_train_errors, nn1_list_test_errors = get_list_errors2( experiment_results=nn1_multiple_experiment_results) nn2_list_units, nn2_list_train_errors, nn2_list_test_errors = get_list_errors2( experiment_results=nn2_multiple_experiment_results) nn3_list_units, nn3_list_train_errors, nn3_list_test_errors = get_list_errors2( experiment_results=nn3_multiple_experiment_results) # plt.figure(3) # list_units = np.array(nn1_list_units) print list_units krls.plot_errors(list_units, nn1_list_train_errors, label='NN1 train', markersize=3, colour='b') krls.plot_errors(list_units, nn1_list_test_errors, label='NN1 test', markersize=3, colour='c') # list_units = 2 * np.array(nn2_list_units) print list_units krls.plot_errors(list_units, nn2_list_train_errors, label='NN2 train', markersize=3, colour='r') krls.plot_errors(list_units, nn2_list_test_errors, label='NN2 test', markersize=3, colour='m') # list_units = 3 * np.array(nn3_list_units) print list_units krls.plot_errors(list_units, nn3_list_train_errors, label='NN3 train', markersize=3, colour='g') krls.plot_errors(list_units, nn3_list_test_errors, label='NN3 test', markersize=3, colour='y') plt.legend() plt.show()
def display_results_HBF1_vs_HBF1(): ## experiment = '/multiple_S_dir' path_to_experiments = './om_results_test_experiments' + experiment hbf1_multiple_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) #mean_train_errors, std_train_errors, mean_test_errors_multiple, std_test_errors_multiple = get_error_stats(multiple_experiment_results) experiment = '/single_S_dir' path_to_experiments = './om_results_test_experiments' + experiment hbf1_single_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) #mean_train_errors, std_train_errors, mean_test_errors_multiple, std_test_errors_multiple = get_error_stats(multiple_experiment_results) experiment = '/hbf2_multiple_S' path_to_experiments = './om_results_test_experiments' + experiment hbf2_multiple_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) #mean_train_errors, std_train_errors, mean_test_errors_single, std_test_errors_single = get_error_stats(single_experiment_results) experiment = '/hbf2_single_S' path_to_experiments = './om_results_test_experiments' + experiment hbf2_single_experiment_results = get_results_for_experiments( path_to_experiments, verbose=True) #mean_train_errors, std_train_errors, mean_test_errors_single, std_test_errors_single = get_error_stats(single_experiment_results) # hbf1_list_units_multiple, hbf1_list_test_errors_multiple = get_list_errors( experiment_results=hbf1_multiple_experiment_results) hbf1_list_units_single, hbf1_list_test_errors_single = get_list_errors( experiment_results=hbf1_single_experiment_results) hbf2_list_units_multiple, hbf2_list_test_errors_multiple = get_list_errors( experiment_results=hbf2_multiple_experiment_results) hbf2_list_units_single, hbf2_list_test_errors_single = get_list_errors( experiment_results=hbf2_single_experiment_results) # plt.figure(3) krls.plot_errors(hbf1_list_units_multiple, hbf1_list_test_errors_multiple, label='HBF1 Multiple Standard Deviations', markersize=3, colour='r') krls.plot_errors(hbf1_list_units_multiple, hbf1_list_test_errors_single, label='HBF1 Single Errors Standard Deviations', markersize=3, colour='m') print len(hbf2_list_test_errors_multiple) print len(hbf1_list_units_multiple) krls.plot_errors(2 * np.array(hbf2_list_units_multiple), hbf2_list_test_errors_multiple, label='HBF2 Multiple Standard Deviations', markersize=3, colour='b') krls.plot_errors(2 * np.array(hbf2_list_units_multiple), hbf2_list_test_errors_single, label='HBF2 Single Errors Standard Deviations', markersize=3, colour='c') #krls.plot_errors_and_bars(list_units_multiple, mean_test_errors_multiple, std_test_errors_multiple, label='Multiple Errors', markersize=3, colour='b') #krls.plot_errors_and_bars(list_units_single, mean_test_errors_single, std_test_errors_single, label='Single Errors', markersize=3, colour='r') # plt.legend() plt.show()