code and material to train the classifier