Distributed learning via diffusion adaptation with application to ensemble learning