.
=head1 CALCULATIONS
The various probabilities used in the above calculations are found
directly from the training documents. For instance, if there are 5000
total tokens (words) in the "sports" training documents and 200 of
them are the word "curling", then C . If there are 10,000 total tokens in the training corpus and
5,000 of them are in documents belonging to the category "sports",
then C

= 5,000/10,000 = 0.5> .
Because the probabilities involved are often very small and we
multiply many of them together, the result is often a tiny tiny
number. This could pose problems of floating-point underflow, so
instead of working with the actual probabilities we work with the
logarithms of the probabilities. This also speeds up various
calculations in the C method.
=head1 TO DO
More work on the confidence scores - right now the winning category
tends to dominate the scores overwhelmingly, when the scores should
probably be more evenly distributed.
=head1 AUTHOR
Ken Williams, ken@forum.swarthmore.edu
=head1 COPYRIGHT
Copyright 2000-2003 Ken Williams. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=head1 SEE ALSO
AI::Categorizer(3), Algorithm::NaiveBayes(3)
"A re-examination of text categorization methods" by Yiming Yang
L
"On the Optimality of the Simple Bayesian Classifier under Zero-One
Loss" by Pedro Domingos
L<"http://www.cs.washington.edu/homes/pedrod/mlj97.ps.gz">
A simple but complete example of Bayes' Theorem from Dr. Math
L<"http://www.mathforum.com/dr.math/problems/battisfore.03.22.99.html">
=cut