Skip to content

Instantly share code, notes, and snippets.

@Hydrotoast
Created December 11, 2012 09:14
Show Gist options
  • Save Hydrotoast/4257243 to your computer and use it in GitHub Desktop.
Save Hydrotoast/4257243 to your computer and use it in GitHub Desktop.
Linear Classification
LinearClassify(w, b, x):
""" Computes a class of a two-class classifier using an n - 1 dimensional hyperplane """
dot_product = sum(i * j for i, j in zip(w, x))
if dot_product > b:
return 1
else:
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment