Exemplo n.º 1
0
    def fit(self, X, Y):

        [Y_new, self.old_to_new, self.new_to_old,
         num_class] = target_process.translate(Y)

        self.classifier = pysol.SOL('ogd', num_class, **self.params)

        self.classifier.fit(X, Y_new)
Exemplo n.º 2
0
    def score(self, X, Y):
        [Y_new, self.old_to_new, self.new_to_old,
         num_class] = target_process.translate(Y)

        accuracy, tpr_fig, fpr_fig, tpr_tab, fpr_tab, auc = self.classifier.score(
            X, Y_new)
        self.drawScore(tpr_fig, fpr_fig, "tpr", "fpr", tpr_tab, fpr_tab, "tpr",
                       "fpr", "Ogd")
        return accuracy, auc
Exemplo n.º 3
0
 def fit(self, X, Y):
     [Y_new, self.old_to_new, self.new_to_old,
      num_class] = target_process.translate(Y)
     try:
         train_accuracy = self.classifier.fit(X, Y_new)
         return train_accuracy
     except AttributeError as e:
         self.classifier = pysol.SOL('stg', num_class, **self.params)
         train_accuracy = self.classifier.fit(X, Y_new)
         return train_accuracy
Exemplo n.º 4
0
 def fit(self, X, Y):
     [Y_new, self.old_to_new, self.new_to_old,
      num_class] = target_process.translate(Y)
     try:
         train_accuracy, update, data, iter, err, time = self.classifier.fit(
             X, Y_new)
         self.drawFit(data, err, "data", "error", data, update, "data",
                      "update", data, time, "data", "time", "Ogd")
         return train_accuracy
     except AttributeError as e:
         self.classifier = pysol.SOL('ogd', num_class, **self.params)
         train_accuracy, update, data, iter, err, time = self.classifier.fit(
             X, Y_new)
         self.drawFit(data, err, "data", "error", data, update, "data",
                      "update", data, time, "data", "time", "Ogd")
         return train_accuracy
Exemplo n.º 5
0
import pysol