If "classify" is supposed to be replaced by "fitcdiscr", why does it provide (better) different results?
1 view (last 30 days)
Show older comments
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 Comment
Alain Kuchta
on 20 Apr 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
Answers (0)
See Also
Categories
Find more on Discriminant Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!