def learn(self):
        print "Input features ", list(self.input_features)
        print "Target feature ", self.target_feature
        features = self.input_data[self.input_features].values
        labels = self.input_data[self.target_feature].values
        test_data_percentage = self.train_data_percentage - 1
        x_train, x_test, y_train, y_actual = cross_validation.train_test_split(
            features, labels, test_size=test_data_percentage, random_state=0)
        self.clf.fit(x_train, y_train)
        y_pred = self.clf.predict(x_test)
        accuracy = round(accuracy_score(y_actual, y_pred), 2)
        recall = round(recall_score(y_actual, y_pred), 2)
        precision = round(precision_score(y_actual, y_pred), 2)
        f1 = round(f1_score(y_actual, y_pred), 2)
        mat = confusion_matrix(y_actual, y_pred)
        true_positives = mat[1][1]
        false_positives = mat[0][1]
        true_negatives = mat[0][0]
        false_negatives = mat[1][0]
        result = {
            'Accuracy Score': accuracy, 'Recall Score': recall,
            'Precision Score': precision, 'F1 Score': f1,
            'True Positives': true_positives,
            'False Positives': false_positives,
            'True Negatives': true_negatives,
            'False Negatives': false_negatives
        }

        print result
        return result
dataset/ETHPy150Open CiscoSystems/cognitive/cognitive/app/ml_models.py/Classifier.learn/swapped operands of `-`