If "classify" is supposed to be replaced by "fitcdiscr", why does it provide (better) different results?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
in my code on the same data:
lda = fitcdiscr(meas(:,1:3),YN); is providing different (worse) results as
[j,err,P,logp,coeff_class] = classify([x y z],meas(:,1:3),YN);
coeff(1,2).linear are quite the same wheras the Const is significatly diffrent. What did I do wrong?
1 comentario
Alain Kuchta
el 20 de Abr. de 2017
I understand that the constant term of the boundary equation for comparing group 1 to group 2 is different when using classify vs fitcdiscr
Please be more specific about why the results are better or worse, and give some summary of the data set you are using.
Based on the variable names I'm assuming you're using the Fisher-Iris data set. A quick test seems to indicate comparable classification since the difference in const is very small:
>> load fisheriris
>> Mdl = fitcdiscr(meas(:,1:3),species(:));
>> [~,err,P,logp,coeff] = classify([1 2 3], meas(:,1:3), species(:));
>> diff = Mdl.Coeffs(1,2).Const - coeff(1,2).const
ans=
-7.105427357601e-14
Respuestas (0)
Ver también
Categorías
Más información sobre Discriminant Analysis en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!