Automatic detection of anti-patterns from source code can reduce software maintenance costs massively. Nowadays, machine learning approaches are very commonly used to identify anti-patterns. Hence, it is very crucial to choose a classifier that can be useful for detecting anti-patterns. This work aims to help practitioners to choose a suitable classifier to detect anti-patterns. In this paper, we highlight 16 classifiers in four different categories to detect anti-patterns. Furthermore, the performance of these classifiers is identified with the data pre-processing (DPP) to detect four commonly occurring anti-patterns from the three commonly used open-source Java projects’ source code. The accuracy of Dagging classifiers is 98.4%. Kernel logistic regression (KLR) also performs well i.e., 97%. In the case of time complexity, naive Bayes (NB), decision trees (DT), support vector machines (SVM), library for support vector machines (LibSVM), logistic, and LightGBM (LB) have less time complexity to build a model in all the projects.