On the validation of earthquake-forecasting models: The case of pattern recognition algorithms