357 def __init__(self):
358 """Constructor"""
359 FittedGroupedDEDXEstimatorTrainer.__init__(self, fit_functions.inverse_sqrt, use_sigma_for_result_fitting=True)
360
361 def train_function(fit_data):
362 """Train on the curated-data median values whose truth value is known"""
363 weighted_p_values = fit_data.apply(lambda data: [data.p_bin_centers] * int(data.number_of_p_values), axis=1).sum()
364 median_value = np.median(weighted_p_values)
365 iqr = np.percentile(weighted_p_values, 75) - np.percentile(weighted_p_values, 50)
366
367 return [iqr, [None, median_value, None]]
368
369
370 self.train_function = train_function
371
372