The following 3 functions should be implemented. Otherwise there will be a problem in the serialization of the classifier.