Skip to content

Commit

Permalink
continuing with svm
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSomen committed Jul 14, 2018
1 parent af82cdc commit e47a8a5
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion SVM/svm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,30 @@
#%%
X_scaled = StandardScaler(X)
svm_clf.fit(X,Y)
svm_clf.predict([[5.5,1.7]])
svm_clf.predict([[5.5,1.7]])

#%%
from sklearn.datasets import make_moons
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures

X,Y = make_moons()
print(X)
print(Y)

#%%
polynomial_svm_clf = Pipeline((
("poly_features",PolynomialFeatures()),
('scaler',StandardScaler()),
('linear_svc',LinearSVC(C=10,loss="hinge")),
))

polynomial_svm_clf.fit(X,Y)

#%%
from sklearn.svm import SVC
poly_kernel_svm_clf = Pipeline((
("scaler", StandardScaler()),
("svm_clf", SVC(kernel="poly", degree=3, coef0=1, C=5))
))
poly_kernel_svm_clf.fit(X, Y)

0 comments on commit e47a8a5

Please sign in to comment.