I have an imbalanced numeric data set that looks like this:
.
I need to bin the data into 8 bins, however if I set the bins to have equal size, I would get all my data only into two bins and the rest in the middle would be empty.
Is there a statistical or mathematical method that would discretize data with fine grained bins when there is a lot of data points, and then make it more coarse grained bins when there is few data points?