def compute_target_weight(self, pred_y, true_y): x, status = scipy_solve(pred_y, true_y, 3, debug=True) if status: x[x < 1e-3] = 0. return x[-1] else: return self.w[-1]
def learn_weights(self, pred_y, true_y): x, status = scipy_solve(pred_y, true_y, 3, debug=True) if status: x[x < 1e-3] = 0. else: x = self.w.copy() return status, x
def learn_source_weights(self, pred_y, true_y): x, status = scipy_solve(pred_y, true_y, 3, debug=True) if status: x[x < 1e-3] = 0. self.w[:self.K] = x