Created
April 24, 2019 21:11
-
-
Save ashokc/fab5f61d0445e1b3d564ae10f91d7796 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def relabelData (x, y, w): | |
lineY = - ( w[0] + w[1] * x ) / w[2] # Current data decision boundary: w[0] + w[1] * x + w[2] * y | |
fvalsY = y - lineY | |
lineX = - ( w[0] + w[2] * y ) / w[1] | |
fvalsX = x - lineX | |
labels = [] | |
for i, fy in enumerate(fvalsY): | |
fx = fvalsX[i] | |
if (fx < 0.0): | |
labels.append(0.0) | |
if (fx > 0.0): | |
labels.append(1.0) | |
labels = np.array(labels) | |
return labels |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment