shad/ML1: add classifying and training. need fix nan dens.