Machine Learning Based Algorithms for Smart Grid Applications