protected function computeProbabilitiesFromCounts(array $class_set, array &$termcount_per_class, array &$termcount, array &$ndocs_per_class, $ndocs, $voccount, $a_smoothing=1)
    {
        $denom_smoothing = $a_smoothing*$voccount;
        foreach ($class_set as $class) {
            $this->priors[$class] = $ndocs_per_class[$class] / $ndocs;
            foreach ($termcount[$class] as $term=>$count) {
                $this->condprob[$term][$class] = ($count + $a_smoothing) / ($termcount_per_class[$class] + $denom_smoothing);
            }
        }
        foreach ($class_set as $class) {
            $this->unknown[$class] = $a_smoothing / ($termcount_per_class[$class] + $denom_smoothing);
        }
    }