Tutorial by Examples

Decision boundary when we classify using logistic regression- Decision boundary when we classify using SVM- As it can be observed, SVM tries to maintain a 'gap' on either side of the decision boundary. This proves helpful when we encounter new data. With new data- Logistic regression perform...
from sklearn import svm X = [[1, 2], [3, 4]] #Training Samples y = [1, 2] #Class labels model = svm.SVC() #Making a support vector classifier model model.fit(X, y) #Fitting the data clf.predict([[2, 3]]) #After fitting, new data can be classified by using predict()

Page 1 of 1