Combine the class predictions of several trees by majority vote. predictions has shape (n_trees, n_samples); for every sample take the class chosen by most trees, breaking ties toward the smallest label.
Implement solve(predictions).
Returns. Return a NumPy array of length n_samples with the voted class for each sample.
Example 1
Input:
solve([[0, 1, 1], [0, 1, 0], [1, 1, 0]])
Output:
[0, 1, 0]
Example 2
Input:
solve([[0, 1], [1, 1], [1, 0], [0, 0]])
Output:
[0, 0]
No results yet
Run your code to check it against the examples, or submit to run every test.