Efficient energy management and data recovery in sensor networks using latent variables based tensor factorization