A Generalization of the Chow-Liu Algorithm and its Application to Statistical Learning