Serialization of dictionary and classifier