(instance, classes)
return classes[max_prob_index], max_prob, instance_with_class
return max_prob and its class where max_prob is the max probably in input instance
return max_prob and its class where max_prob is the max probably in input instance
return max_prob and its class where max_prob is the max probably in input instance
def __get_multi_class_res(instance, classes):
        """
        return max_prob and its class where max_prob is the max probably in input instance
        """
        max_prob = -1
        max_prob_index = -1
        instance_with_class = {}
        for (i, prob) in enumerate(instance):
            instance_with_class[classes[i]] = prob
            if prob > max_prob:
                max_prob = prob
                max_prob_index = i

        return classes[max_prob_index], max_prob, instance_with_class
def __get_multi_class_res ( instance , classes ) : max_prob = - 1 max_prob_index = - 1 instance_with_class = { } for ( i , prob ) in enumerate ( instance ) : instance_with_class [ classes [ i ] ] = prob if prob > max_prob : max_prob = prob max_prob_index = i return classes [ max_prob_index ] , max_prob , instance_with_class