error in svm classifier
Afficher commentaires plus anciens
hello, I would like generate one class of points inside the unit disk in two dimensions, and another class of points in the annulus from radius 1 to radius 2. then, Train SVM Classifiers on this data. this line have error :ezpolar(@(x)1); I run this code in R2014a but it gives the error:
"Error using text Too many input arguments.
Error in ezpolar (line 74) text(0,-1.35*max(abs(RHO)),['r = ', texlabel(rho0)], ...
Error in svmme (line 16) ezpolar(@(x)1)"
this code is:
rng(1); % For reproducibility
r = sqrt(rand(100,1)); % Radius
t = 2*pi*rand(100,1); % Angle
data1 = [r.*cos(t), r.*sin(t)]; % Points
r2 = sqrt(3*rand(100,1)+1); % Radius
t2 = 2*pi*rand(100,1); % Angle
data2 = [r2.*cos(t2), r2.*sin(t2)]; % points
figure;
plot(data1(:,1),data1(:,2),'r.','MarkerSize',15)
hold on
plot(data2(:,1),data2(:,2),'b.','MarkerSize',15)
ezpolar(@(x)1);
ezpolar(@(x)2);
axis equal
hold off
data3 = [data1;data2];
theclass = ones(200,1);
theclass(1:100) = -1;
%Train the SVM Classifier
cl = fitcsvm(data3,theclass,'KernelFunction','rbf',...
'BoxConstraint',Inf,'ClassNames',[-1,1]);
1 commentaire
Image Analyst
le 5 Juil 2018
Don't double space your code. Simply read this link to learn how to format it as code instead of ordinary text. Basically highlight and click {}Code.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Support Vector Machine Regression dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
