Modeling Complex Multicomponent Materials with First-Principles Based Statistical Mechanics and Machine Learning