Often, after the learning and teaching process is over, students will be tested with quizzes, midterm exams, and even end-of-semester exams, but these exams still take time after the teacher has taught several weeks or months that have passed; what if after teaching, for example, a math lesson, and students immediately understand or do not understand at all, and this can be detected using Machine Learning. The variable that can be raised is the value or quiz grade of a particular subject; for example, mathematics is one of the disliked subjects for most elementary school students, but how to find out that the student is able or unable to solve math problems and predict the end of semester grades for mathematics, this can be determined using Machine Learning, using the KNN Algorithm or K-MEANS method, or other methods that are deemed appropriate to the existing case study. In this case study, it is predicted whether a variable affects each other or affects other variables; this is done by doing or drawing relationships between variables. This research successfully concluded from the performance of machine learning in predicting students' understanding of math lessons after teaching and learning activities ended. The parameters that will be used for testing are population and sampling, and then data analysis, validity, and reliability tests are carried out.