how can use it for more than two features plot for multiclass svm?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sheema Khattak
el 15 de Ag. de 2014
Respondida: Salaheddin Hosseinzadeh
el 15 de Ag. de 2014
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 comentarios
Respuestas (1)
Salaheddin Hosseinzadeh
el 15 de Ag. de 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!
0 comentarios
Ver también
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!