def outFrac_3sigma68_1pz(z1, z2): delta_z_1pz = bhz.delta_z_1pz(z1, z2) return bhz.outFrac_3sigma68(delta_z_1pz)
def median_1pz(z1, z2): delta_z_1pz = bhz.delta_z_1pz(z1, z2) return np.median(delta_z_1pz)
def sigma_68_1pz(z1, z2): delta_z_1pz = bhz.delta_z_1pz(z1, z2) return bhz.sigma_68(delta_z_1pz)
res[ptype][f][test_name] = {} #should we calculate an error on these metrics error_function = pval.key_not_none(tst, 'error_function') err_metric = {} if error_function: for ef in tst['error_function']: #turn error function.string into a function err_metric[ef.split('.')[-1]] = pval.get_function(ef) for photoz in tst['predictions']: res[ptype][f][test_name][photoz] = {} diff = pval.delta_z(d[tst['truths']], d[photoz]) diff_1pz = pval.delta_z_1pz(d[tst['truths']], d[photoz]) points = {'delta_z': diff, 'diff_1pz': diff_1pz} for metric in tst['metrics']: #set all objects equal weight, unless defined weights = get_weights(tst, 'weights', d) res[ptype][f][test_name][photoz][metric] = {} #turn string into function metric_function = pval.get_function(metric) #which residuals shall we employ? for diffpp in points.keys():