

def compute_uboost_multipliers(self, sample_weight, score, y):
    'Returns uBoost multipliers to sample_weight\n        and computed global cut'
    signed_score = (score * self.signed_uniform_label)
    signed_score_cut = compute_cut_for_efficiency(self.target_efficiency, (y == self.uniform_label), signed_score)
    global_score_cut = (signed_score_cut * self.signed_uniform_label)
    local_efficiencies = compute_group_efficiencies(signed_score, self.knn_indices, cut=signed_score_cut, smoothing=self.smoothing)
    e_prime = np.average(np.abs((local_efficiencies - self.target_efficiency)), weights=sample_weight)
    is_uniform_class = (y == self.uniform_label)
    beta = np.log((1.0 / e_prime))
    boost_weights = np.exp((((self.target_efficiency - local_efficiencies) * is_uniform_class) * (beta * self.uniforming_rate)))
    if self.keep_debug_info:
        self.debug_dict['local_effs'].append(local_efficiencies.copy())
    return (boost_weights, global_score_cut)

dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/uboost.py uBoostBDT.compute_uboost_multipliers/original