496e3d795c1f33010899f34c2e171a76a3d8e75c,codes/2-basics_in_machine_learning/linear_svm/code/linear_SVM.py,,,#,70

Before Change


    line = []
    line = [-w2/w1*i+b/w1 for i in x_line]

    positive_X = [data[1] for index,data in enumerate(X) if y[index]==1]
    positive_y = [data[0] for index,data in enumerate(X) if y[index]==1]
    negative_X = [data[1] for index,data in enumerate(X) if y[index]==-1]
    negative_y = [data[0] for index,data in enumerate(X) if y[index]==-1]

After Change


        if y[index] == 1:
            positive_X = data[1]
            positive_y = data[0]
        elif y[index] == 0:
            negative_X = data[1]
            negative_y = data[0]
        else:
            sys.exit("Invalid label!")

    // Plotting the SVM decision boundary.
    plt.plot(positive_X, positive_y, "+", label="Positive")
    plt.plot(negative_X, negative_y, "o", label="Negative")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: astorfi/TensorFlow-World
Commit Name: 496e3d795c1f33010899f34c2e171a76a3d8e75c
Time: 2017-06-14
Author: amirsina.torfi@gmail.com
File Name: codes/2-basics_in_machine_learning/linear_svm/code/linear_SVM.py
Class Name:
Method Name:


Project Name: aertslab/pySCENIC
Commit Name: 0e6804ca93a4f76300134a126d5942114b71901c
Time: 2018-12-14
Author: vandesande.bram@gmail.com
File Name: src/pyscenic/cli/pyscenic.py
Class Name:
Method Name: prune_targets_command


Project Name: calico/basenji
Commit Name: 98b1fe8f5c1acccb31c10028bccaa797470279d2
Time: 2019-08-23
Author: drk@calicolabs.com
File Name: bin/basenji_map.py
Class Name:
Method Name: main