Feature Extraction in Regression and Classification with Structured Predictors