categ_reducer function

Reduce categorical values