def _normalize_weight(self, y, weight):
        # frequently algorithm assigns very big weight to signal events
        # compared to background ones
        weight += 1e-30
        weight[y == 0] /= np.mean(weight[y == 0])
        weight[y == 1] /= np.mean(weight[y == 1])
        return weight
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/uboost.py/uBoostBDT._normalize_weight/original