how can use it for more than two features plot for multiclass svm?

1 Ansicht (letzte 30 Tage)
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!

Antworten (1)

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh am 15 Aug. 2014
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!

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by