The research presented in this dissertation discusses a novel approach to address the corrosion of underground metallic structures. The system consists of using Wenner’s four electrodes method to measure the electrical resistivity of the soil (e.g., clayey silt and clay), applying two machine-learning algorithms (k Nearest Neighbor (Knn) and Supervised Vector Machine (SVM)) to predict the type of soil, and help engineers to leverage the extracted parameters to select the best material that withstands corrosion in that specific environment. A dataset of 162 sample points was obtained from different kinds of literature (142 training, and 20 testing points). The results show that given the electrical resistivity of soil and its moisture, the k nearest neighbor model is capable of predicting the type of soil with accuracy, error rate, sensitivity, specificity, and precision of 70%, 30%, 64%, 83%, and 90% respectively. In contrast, the support vector machine model was not able to perform soil prediction, presenting an error rate and accuracy of 44.1% and 55.9 % respectively. This dissertation also provides suggestions such as increasing the number of sample points to improve the performance of the machine learning algorithms.