📝머신러닝 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')
'인공지능 > Machine Learning' 카테고리의 다른 글
[Machine Learning] 분류예측 Decision Tree (0) | 2022.12.02 |
---|---|
[Machine Learning] 성능향상 GridSearchCV() (0) | 2022.12.02 |
[Machine Learning] 분류예측 K-Nearest Neighbor(K-NN) (1) | 2022.12.02 |
[Machine Learning] 성능측정 confusion_matrix() (0) | 2022.12.02 |
[Machine Learning] 분류예측 LogisticRegression (0) | 2022.12.01 |
댓글