Created
March 21, 2020 16:28
-
-
Save tarlanahad/553c4fed8dd6e0680e53845ef4b01d93 to your computer and use it in GitHub Desktop.
This file contains 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
class SVM: | |
def __init__(self, X, y, num_of_epochs, lr, C): | |
self.X = X | |
self.y = y | |
self.num_of_epochs = num_of_epochs | |
self.lr = lr | |
self.C = C | |
# Add column vector of ones for computational convenience | |
self.X = np.column_stack((np.ones(len(X)), X)) | |
# Initialize normal vector | |
self.w = np.ones(len(self.X[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment