Skip to content

Instantly share code, notes, and snippets.

@Higgcz
Created October 11, 2012 20:14
Show Gist options
  • Save Higgcz/3875195 to your computer and use it in GitHub Desktop.
Save Higgcz/3875195 to your computer and use it in GitHub Desktop.
Getting classification tresholds.
function [treshold, direction] = classificationTreshold(D1, D2)
meA=D1.Mean;
siA=D1.Sigma;
meC=D2.Mean;
siC=D2.Sigma;
hlavni = (siC^2-siA^2);
funA = [
hlavni
(2*(siA^2*meC-siC^2*meA))
((siC^2*meA^2-siA^2*meC^2) - log((D1.Prior/siA)/(D2.Prior/siC)) * (2*siA^2*siC^2))
];
treshold = roots(funA);
direction = (hlavni > 0);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment