Created
December 11, 2012 09:14
-
-
Save Hydrotoast/4257243 to your computer and use it in GitHub Desktop.
Linear Classification
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
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