The water supply networks of many countries are experiencing a drastic increase in the number of pipe failures. To reverse this tendency, it is essential to optimise the replacement plans of pipes. For this reason, companies demand pioneering techniques to predict which pipes are more prone to fail. In this study, an Artificial Neural Network (ANN) is designed to classify pipes according to their predisposition to fail based on physical and operational input variables. In addition, the usefulness and effectiveness of two sampling methods, under-sampling and over-sampling, are analysed. The implementation of the model is done using the open-source software Weka, which is specialised in machine-learning algorithms. The system is tested with a database from a real water network in Spain, obtaining high-accurate results. It is verified that the balance of the training set is imperative to increase the predictions’ accurateness. Furthermore, under-sampling prioritises true positive rates, whereas over-sampling makes the system learn to predict failures and non-failures with the same precision.