Data Mining is a growing field, a strand of which is Educational data mining (EDM). EDM is currently used to help institutions and students through creating accurate predictions that are considered in decision making. One of EDM’s concerns is that of predicting students’ academic performance and fundamental learning difficulties in a particular course. In fact, EDM can help computer science (CS)-enrolled students to predict whether they can pass their courses without taking further action. An introductory programming course is usually the first challenging course faced by students in CS departments since a student’s performance in such a course is highly based on their intellectual skills. This paper presents a real case study from one of Saudi Arabia’s leading universities. This study used well-known prediction models— specifically, decision tree (DT), k-nearest neighbor (kNN), Naïve Bayes (NB), and support vector machine (SVM) models—to create a reliable prediction model for at-risk students in an introductory programming course using preliminary performance information showing their self-efficacy. The results of this study showed that the DT and SVM models yielded the best performance with the highest accuracy rate (99.18%). Furthermore, comparisons between the applied models were conducted with different evaluation metrics.