single-class and multi-class pattern