The detection and classification of heavy metals is a growing need to guarantee the quality of process water in different industries. However, the official methodologies to evaluate the presence of these contaminants require samples pre-processing, making them time-consuming and expensive; these elements do not allow online monitoring. For this reason, new technologies are required for online monitoring and evaluation. In this work, a new methodology is presented for the detection and classification of different heavy metal ions such as: As, Pb and Cd. Commercial graphite sensors modified with 2D molybdenite were used applying an electroanalytical technique of square wave voltammetry. Subsequently, signal processing based on pattern recognition and machine learning methods was carried out. This classification methodology includes the following steps: data display and arrangement, dimensionality reduction through the t-distributed stochastic neighbor embedding (t-SNE) method, which serves as feature extraction, and the support vector machines (SVM) method as a classifier. The validation is carried out with a data set of 118 aqueous samples. Leave one out cross-validation (LOOCV) was used to obtain classification accuracy. The results showed a classification accuracy of 98.31% with only two errors of the experimental validation with this data set. It is concluded that this methodology is a useful tool for detecting the presence of these ions in aqueous samples with MoS2-2D.