WEKA classification likelihood of the classes

后端 未结 4 1004
轻奢々
轻奢々 2021-01-12 19:58

I would like to know if there is a way in WEKA to output a number of \'best-guesses\' for a classification.

My scenario is: I classify the data with cross-validatio

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 20:38

    when you calculate a probability for the instance, how exactly do you do this?

    I have posted my PART rules and data for the new instance here but as far as calculation manually I am not so sure how to do this! Thanks

    EDIT: now calculated:

    private float[] getProbDist(String split){

    // takes in something such as (52/2) meaning 52 instances correctly classified and 2 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;    
    }
    

提交回复
热议问题