when you calculate the probability for an instance, how exactly do you do it?
I have posted my PART rules and data for the new instance here , but since the calculation is manual, I'm not sure how to do it! Thanks
EDIT: now calculated:
private float [] getProbDist (line break) {
// accepts something like (52/2), which means that 52 instances are correctly classified and 2 are incorrectly classified.
if(prob_dis.length > 2) return null; if(prob_dis.length == 1){ String temp = prob_dis[0]; prob_dis = new String[2]; prob_dis[0] = "1"; prob_dis[1] = temp; } float p1 = new Float(prob_dis[0]); float p2 = new Float(prob_dis[1]); // assumes two tags float[] tag_prob = new float[2]; tag_prob[1] = 1 - tag_prob[1]; tag_prob[0] = (float)p2/p1; // returns double[] as being the probabilities return tag_prob; }
source share