A local approach to parameter space reduction for regression and classification tasks