def echo_summary_table_row(model, epoch, hidden): translate = { 'inference-features': 'W', 'forward-selection': 'F' } data = get_data(model, epoch, hidden) auc = np.array(data['auc']) low, high, _ = ci(auc) print r'& %s %s hidden %s iter & \T\B %.04f & %.06f & [%.04f,%.04f]\\\cline{2-5}' % (translate[model], hidden, epoch, auc.mean(), auc.std(ddof=1), low, high)
def echo_result(model, epoch, num_hidden): data = get_data(model, epoch, num_hidden) auc = np.array(data['auc']) low, high, _ = ci(auc) title = get_title(model, epoch, num_hidden) print r'\subsection{%s}' % (title,) echo_auc_table(auc, title) echo_statistics(auc) print '' print ''
def echo_logreg_rows(): datafiles = [ ('W', 'sessions/17-recreating-winning-entry/data/inference-features-for-report.json'), ('F top 3', 'sessions/18-forward-selection/data/top-3-features-for-report.json'), ('F all feat', 'sessions/18-forward-selection/data/all-features-for-report.json') ] for title, path in datafiles: data = json.load(open(path)) auc = np.array(data['auc']) low, high, _ = ci(auc) print r'& %s & \T\B %.04f & %.06f & [%.04f,%.04f]\\\cline{2-5}' % (title, auc.mean(), auc.std(ddof=1), low, high)
def echo_statistics(auc): m = auc.mean() std = auc.std(ddof=1) low, high, _ = ci(auc) print r'''\subsubsection{Statistics on the AUC-score} First the sample mean and sample standard deviation are calculated \[ m = %.04f \quad\quad\text{and}\quad\quad s = %.06f \] which gives the 95\%% confidence interval \[ \CI{%.04f}{%.04f} \]''' % (m, std, low, high)