본문 바로가기
인공지능/Machine Learning

[Machine Learning] 분류예측 Support Vector Machine

by coding_su 2022. 12. 2.

📝머신러닝 Support Vector Machine

from sklearn.svm import SVC

 

SVC(Support Vector Classification)

# 변수에 저장하여 사용
# kernel='linear' or 'rbf'
classifier = SVC(kernel='linear')
classifier = SVC(kernel='rbf')

classifier = SVC(kernel='linear', random_state=1)

# 학습, 테스트
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)

# 예측
from sklearn.metrics import confusion_matrix, accuracy_score

confusion_matrix(y_test, y_pred)
accuracy_score(y_test, y_pred)

SVC(kernel='linear') / SVC(kernel='rbf')

 

댓글