A dynamic ensemble learning algorithm for neural networks