implement serializing of classifier