How to draw hyperplane using 'fitcsvm'
이전 댓글 표시
以下が fitcsvmのサンプルコードですが、最後のPlotの中に、2つのカテゴリを分類するhyperplane を描きたいのですが、
ご存知の方、方法をご教授願えませんでしょうか。宜しくご確認お願い致します。
https://jp.mathworks.com/help/stats/fitcsvm.html
-----------------------------------------
load fisheriris
inds = ~strcmp(species,'setosa');
X = meas(inds,3:4);
y = species(inds);
SVMModel = fitcsvm(X,y);
sv = SVMModel.SupportVectors;
figure
gscatter(X(:,1),X(:,2),y)
hold on
plot(sv(:,1),sv(:,2),'ko','MarkerSize',10)
legend('versicolor','virginica','Support Vector')
hold off
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB の Python ライブラリ에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!