how can use it for more than two features plot for multiclass svm?
2 ビュー (過去 30 日間)
古いコメントを表示
pos = find(y == 1); neg = find(y == -1); plot(x(pos,1), x(pos,2), 'ko', 'MarkerFaceColor', 'b'); hold on; plot(x(neg,1), x(neg,2), 'ko', 'MarkerFaceColor', 'g')
% Plot the decision boundary plot_x = linspace(min(x(:,1)), max(x(:,1)), 30); plot_y = (-1/w(2))*(w(1)*plot_x + b); plot(plot_x, plot_y, 'k-', 'LineWidth', 2)
title(sprintf('SVM Linear Classifier with C = %g', C), 'FontSize', 14)
I also get this error Error using + Matrix dimensions must agree. which is for this statement plot_y = (-1/w(2))*(w(1)*plot_x + b);
where w is 2*2 and b is 3*1
kindly help!
0 件のコメント
回答 (1 件)
Salaheddin Hosseinzadeh
2014 年 8 月 15 日
Hey shah,
There's no surprise you got error adding plot_x and b, because apparently plot_x is 1x30 and as you said b is 3*1
You can't do it either! I don't really know how can someone help u!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!