function featureSelector($wordbank_file) { global $wordBank, $positive, $negative, $total; global $max_positive, $max_negative, $max_total; readWordBankFromJSON($wordbank_file); sortPositiveNegative(); $max_positive = max($positive); $max_negative = max($negative); $max_total = max($total); print "\n" . $max_positive . "\t" . $max_negative . "\t" . $max_total . "\n"; print count($wordBank) . " => "; removeLowFreqWords(); normalizePositiveLowFreqWords(); normalizeNegativeLowFreqWords(); writeWordBankToJSON($wordbank_file); print count($wordBank) . "\n"; }
function featureSelector($wordbank_file) { global $wordBank, $pd, $total, $positive, $negative; global $max_pd, $min_pd, $max_total, $max_positive, $max_negative; readWordBankFromJSON($wordbank_file); findProportionalDiff(); $max_pd = max($pd); $min_pd = min($pd); $max_total = max($total); $max_positive = max($positive); $max_negative = max($negative); print $max_pd . " / " . $min_pd . "\t" . $max_total . "\n"; print count($wordBank) . " => "; removeLowFreqWords(); removeLowCPDWords(); normalizePositiveLowFreqWords(); normalizeNegativeLowFreqWords(); writeWordBankToJSON($wordbank_file); print count($wordBank) . "\n"; }