Machine-learning algorithms for infrastructure automation