I found something in R which may do Nelder binning. https://rdrr.io/rforge/labeling/src/R/labeling.R