Education is essential for achieving many Sustainable Development Goals (SDGs). Therefore, the education system focuses on empowering more educated people and improving the quality of the education system. One of the latest technologies to enhance the quality of education is Artificial Intelligence (AI)-based Machine Learning (ML). As a result, ML has a significant influence on the education system. ML is currently widely applied in the education system for various tasks, such as creating models by monitoring student performance and activities that accurately predict student outcomes, their engagement in learning activities, decision-making, problem-solving capabilities, etc. In this research, we provide a survey of machine learning frameworks for both distributed (clusters of schools and universities) and centralized (university or school) educational institutions to predict the quality of students' learning outcomes and find solutions to improve the quality of their education system. Additionally, this work explores the application of ML in teaching and learning for further improvements in the learning environment for centralized and distributed education systems.