def get_title(rf_local): # when you are asked to "shadow name", you should change the name. x = rf_local.get_test_set_original_results() y = rf_local.testResults type_str = BPTypes.get_type_name(rf_local.type) stats_toolkit_obj = StatsToolKits(x, y) pearson_r, p_val = stats_toolkit_obj.get_pearson_corr() mic = stats_toolkit_obj.get_mic() return type_str + ' ' + 'Regression Results\n' + \ 'pearson regression: ' + '%.2f' % pearson_r + ' p value: ' + '%.2e' % p_val + '\n'\ 'maximal information coefficient: ' + '%.2f' % mic
def disp_stats_paras(rf_local): stats_toolkit_obj = StatsToolKits([], []) print("testset size:" + "%d" % (len(rf_local.get_test_set_original_results()) / 0.2)) print("testset range:" + "%d" % stats_toolkit_obj.get_range(rf_local.get_test_set_original_results())) print("standard derivation:" + "%.2f" % stats_toolkit_obj.get_std(rf_local.get_test_set_original_results()))
print("sbp max index:" + str(max_sbp_index) + " ") print(sbp_corrs) print("dbp max index:" + str(max_dbp_index) + " ") print(dbp_corrs) rf = RegressionAlgorithm() rf.x_train = full_set_arr[max_sbp_train_index, :] rf.y_train = full_set_res[max_sbp_train_index] rf.x_test = full_set_arr[max_sbp_test_index, :] rf.y_test = full_set_res[max_sbp_test_index] rf.train_mbp() cor = rf.test() # rf.show_full_set_result("Best SBP Regression") rf.show_mbp_full_set_result("Best SBP Regression", list(rf.y_test)) stk = StatsToolKits(cor, full_set_res[max_sbp_test_index]) cor = stk.get_pearson_corr() print('***************SBP CORR') print cor # rf.reset_model() # rf.alter_type() # rf.x_train = full_set_arr[max_dbp_train_index, :] # rf.y_train = full_set_res[max_dbp_train_index, :] # rf.x_test = full_set_arr[max_dbp_test_index, :] # rf.y_test = full_set_res[max_dbp_test_index, :] # rf.train() # rf.test() # rf.show_full_set_result("Best DBP Regression") exit()