still has a bug. since in nb fittinig it will just use the unique value of the ydata. so the n_classes may become smaller. How to force the nb stays the same n_classes?
fix the dimension bug. still need to look at stop criteria