Skip to content

Instantly share code, notes, and snippets.

@lastlegion
Created October 9, 2013 13:15
Show Gist options
  • Save lastlegion/6901098 to your computer and use it in GitHub Desktop.
Save lastlegion/6901098 to your computer and use it in GitHub Desktop.
Hypothesis for percpetron
def hypothesis(X,w):
h = X*w.transpose()
for i in range(0,N):
if h.item(i) >= 0:
h[i] = 1
else:
h[i] = -1
return h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment