When modeling temporal processes, just like in pattern recognition, selecting the optimal number of inputs is of central concern. We take advantage of specific features of temporal modeling to propose a novel method for extracting the inputs that attempts to yield the best predictive performance. The method relies on the use of estimators of the generalization error to assess the predictive performance of the model. This technique is first applied to time series processing, where we perform a number of experiments on synthetic data, as well as a real life dataset, and compare the results to a benchmark physical method. Finally, the method is extended to system identification and illustrated by the estimation of a linear FIR filter on functional magnetic resonance (fMRI) signals.