Example #1
0
 def update_fit_params(self, X_train, y_train, eval_set, weights):
     output_dim, train_labels = infer_multitask_output(y_train)
     for _, y in eval_set:
         for task_idx in range(y.shape[1]):
             check_output_dim(train_labels[task_idx], y[:, task_idx])
     self.output_dim = output_dim
     self.classes_ = train_labels
     self.target_mapper = [{
         class_label: index
         for index, class_label in enumerate(classes)
     } for classes in self.classes_]
     self.preds_mapper = [{
         index: class_label
         for index, class_label in enumerate(classes)
     } for classes in self.classes_]
     self.updated_weights = weights
     filter_weights(self.updated_weights)
Example #2
0
 def update_fit_params(
     self,
     X_train,
     y_train,
     eval_set,
     weights,
 ):
     output_dim, train_labels = infer_output_dim(y_train)
     for X, y in eval_set:
         check_output_dim(train_labels, y)
     self.output_dim = output_dim
     self._default_metric = ('auc' if self.output_dim == 2 else 'accuracy')
     self.classes_ = train_labels
     self.target_mapper = {
         class_label: index for index, class_label in enumerate(self.classes_)
     }
     self.preds_mapper = {
         index: class_label for index, class_label in enumerate(self.classes_)
     }
     self.updated_weights = self.weight_updater(weights)