Efficient Energy Management and Data Recovery in Sensor Networks using Latent Variables Based Tensor Factorization