Naive Bayes Algorithm

Dear All

I have an implementation of Naive Bayes. The algorithm's ouput are class labels and their propabilities.

I want to do the following: I want to the algorithm to sort the propabilities and then return the class label with the greater possibility.

How can I do this? Array?

Should I create a seperate class? How wil this class will communicate with the main class of the algorithm?

Best Regards

Olga

[449 byte] By [Olgaa] at [2007-10-3 9:19:11]
# 1
I would suggest creating a class that stores each result with its probabiltiy. Then put these results in a list or an array and sort them. (Make sure that this new class implements Comparable).
zadoka at 2007-7-15 4:32:20 > top of Java-index,Other Topics,Algorithms...