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]
Пример #2
0
 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
Пример #3
0
 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