Encapsulate categorical feature encoding in new class