(Collection<Integer> catCounts)
| 225 | } |
| 226 | |
| 227 | public static List<Float> getCategoryRatios(Collection<Integer> catCounts) { |
| 228 | List<Float> ratios = new ArrayList<>(); |
| 229 | int n = BuffUtils.sum(catCounts); |
| 230 | for (Integer count : catCounts) { |
| 231 | float probCat = count/(float) n; |
| 232 | ratios.add(probCat); |
| 233 | } |
| 234 | return ratios; |
| 235 | } |
| 236 | |
| 237 | public static HashBag<Integer> getCategoriesBag(Collection<Integer> categories) { |
| 238 | HashBag<Integer> votes = new HashBag<>(); |
no test coverage detected