f3a426f88da4760895a42751b1fe668fee3a834f,qiskit_aqua/algorithms/classical/svm/svm_classical_multiclass.py,SVM_Classical_Multiclass,run,#SVM_Classical_Multiclass#,36

Before Change


        put the train, test, predict together
        
        if self.training_dataset is None:
            self.ret["error"] = "training dataset is missing! please provide it"
            return self.ret

        X_train, y_train, label_to_class = multiclass_get_points_and_labels(self.training_dataset, self.class_labels)
        X_test, y_test, label_to_class = multiclass_get_points_and_labels(self.test_dataset, self.class_labels)

        self.multiclass_classifier.train(X_train, y_train)

        if self.test_dataset is not None:
            success_ratio = self.multiclass_classifier.test(X_test, y_test)
            self.ret["test_success_ratio"] = success_ratio

        if self.datapoints is not None:
            predicted_labels = self.multiclass_classifier.predict(X_test)
            predicted_labelclasses = [label_to_class[x] for x in predicted_labels]
            self.ret["predicted_labels"] = predicted_labelclasses
        return self.ret

After Change


        
        put the train, test, predict together
        
        self.train(self.training_dataset[0], self.training_dataset[1])
        if self.test_dataset is not None:
            self.test(self.test_dataset[0], self.test_dataset[1])
        if self.datapoints is not None:
            predicted_labels = self.predict(self.datapoints)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: f3a426f88da4760895a42751b1fe668fee3a834f
Time: 2018-08-31
Author: chenrich@us.ibm.com
File Name: qiskit_aqua/algorithms/classical/svm/svm_classical_multiclass.py
Class Name: SVM_Classical_Multiclass
Method Name: run


Project Name: OpenNMT/OpenNMT-py
Commit Name: b87368e1e7fd832b505db9cc08015ac7af8f95de
Time: 2016-12-23
Author: jvanamersfoort@twitter.com
File Name: VAE/main.py
Class Name:
Method Name: train