$auto_weight{$keyword} = $results_by_this_keyword/$results_combined;
}
-my $max_weight = max(values %auto_weight);
+my $avg_weight = sum(values %auto_weight) / scalar keys %auto_weight;
for my $keyword (keys %auto_weight) {
- $auto_weight{$keyword} = $auto_weight{$keyword}/$max_weight;
+ $auto_weight{$keyword} = $auto_weight{$keyword}/$avg_weight;
}
print {$results_fh} join(',',map {qq("$_")} @csv_fields),qq(\n);