Skip to content

Commit

Permalink
going with kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSomen committed Jul 15, 2018
1 parent 814400c commit 8f6838e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion SVM/svm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
print(Y)

#%%
'''
for non linear distinction datasets
'''
polynomial_svm_clf = Pipeline((
("poly_features",PolynomialFeatures()),
('scaler',StandardScaler()),
Expand All @@ -45,4 +48,12 @@
("scaler", StandardScaler()),
("svm_clf", SVC(kernel="poly", degree=3, coef0=1, C=5))
))
poly_kernel_svm_clf.fit(X, Y)
poly_kernel_svm_clf.fit(X, Y)

#%%
rbf_kernel_svm_clf = Pipeline((
("scaler",StandardScaler()),
("svm_clf",SVC(kernel='rbf',gamma=5,C=0.001))
))
rbf_kernel_svm_clf.fit(X,Y)

0 comments on commit 8f6838e

Please sign in to comment.