[Classifier4j-devel] Fwd: calculateOverallProbability Questions
Status: Beta
Brought to you by:
nicklothian
From: Matt C. <MCo...@my...> - 2003-11-17 21:30:58
|
Can someone explain to me what is happening in calculateOverallProbability. The "probability" for each word drawn into this method via calcWordsProbabilty is .99 if atleast one occurance of word exists in the database in the given category and .5 (Neutral) if the word does not occur in the given category. This does not seem right to me. I am not sure, when, where, how and why the probability on the words is getting assigned as described. Another thing that is confusing me is that several time during to course of this method, the variable "z" goes to 0 (zero) and the process continues. Attached is the tail end of a log of this method. If z goes to zero over and over, what is the point of performing this calculation. It seems the calculation would only take into account those words that are processed after the very last time Z goes to zero. I simply added: System.out.println("Z : [" + z +"] Word : [" + wps[i].getWord()+"] Probability : [" + wps[i].getProbability() + "]"); after each assignment of z in BayesianClassifer.calculateOverallProbability() Also, z is recalculated on each occurence of a particular word. Is this proper? Matt Collier RemoteIT mco...@my... 877-4-NEW-LAN |