Ejemplo 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)
Ejemplo n.º 2
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
Ejemplo n.º 3
0
 def fit(self, X, Y):
     num_class = len(set(Y))
     try:
         return self.classifier.fit(X, Y)
     except AttributeError as e:
         self.classifier = pysol.SOL('ogd', num_class, **self.params)
         accuracy, update, data, iter, err, time = self.classifier.fit(X, Y)
         plt.figure
         plt.plot(data, err, "r*")
         plt.plot(data, err, label="test", color="red", linewidth=2)
         plt.xlabel("data")
         plt.ylabel("error")
         plt.legend()
         plt.show()
         return accuracy
Ejemplo 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
Ejemplo n.º 5
0
import pysol