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)
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
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
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
import pysol