Deep Forest (Zhou & Feng, 2017) stacks layers of random forests, and each layer passes a class vector to the next one. The class vector is the distribution of labels in the leaves a sample reaches, averaged over trees.
Implement class_distribution(labels, n_classes), returning the fraction of samples in each class.
Count with np.bincount using minlength=n_classes, then divide by the total.
No results yet
Run your code to check it against the examples, or submit to run every test.