Nonlinear Feature Aggregation: Two Algorithms driven by Theory