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!