add implementation for training classifier