handling regression and classification