If "classify" is supposed to be replaced by "fitcdiscr", why does it provide (better) different results?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Alain Kuchta
2017년 4월 20일
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discriminant Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!