Machine Learning: Theoretical Foundations and Practical Applications