added training and inference of mnb