295 def __init__(self):
296 """Constructor"""
297 FittedGroupedDEDXEstimatorTrainer.__init__(self, fit_functions.inverse_squared, use_sigma_for_result_fitting=True)
298
299 def train_function(fit_data):
300 """Train on the curated-data median values whose truth value is known"""
301 weighted_p_values = fit_data.apply(lambda data: [data.p_bin_centers] * int(data.number_of_p_values), axis=1).sum()
302 median_value = np.median(weighted_p_values)
303 iqr = np.percentile(weighted_p_values, 75) - np.percentile(weighted_p_values, 50)
304
305 return [iqr, [None, median_value, None]]
306
307
308 self.train_function = train_function
309
310