Problems of nonparametric filtering arises frequently in engineering and financial economics. Nonparametric filters often involve some filtering parameters to choose. These parameters can be chosen to optimize the performance locally at each time point or globally over a time interval. In this article, the filtering parameters are chosen via minimizing the prediction error for a large class of filters. Under a general martingale setting, with mild conditions on the time series structure and virtually no assumption on filters, we show that the adaptive filter with filtering parameter chosen by historical data performs nearly as well as the one with the ideal filter in the class, in terms of filtering errors. The theoretical result is also ve...