Preterm birth is a significant cause of perinatal morbidity and mortality, where early and reliable risk prediction can substantially reduce complications and improve maternal and neonatal health outcomes. Electrohysterography (EHG) emerges as a suitable non-invasive technique for monitoring uterine activity and detecting preterm labor, offering higher accuracy and robustness against noise compared to traditional methods. This study focuses on the classification of term and preterm records using three machine learning algorithms: decision trees, subspace k-nearest neighbors, and a trilayered neural network. The performance of these algorithms is evaluated using the evaluation metrics of accuracy (ACC), sensitivity (SE), positive predictive value (PPV), and F1-score. Results showed that the highest classification accuracy was achieved with decision trees, both on the original imbalanced dataset (ACC = 85.56%, SE = 87.01%, PPV = 98.09%, F1 = 92.22%) and on the dataset balanced using the synthetic minority oversampling technique (ACC = 69.44%, SE = 85.42%, PPV = 78.34%, F1 = 81.73%). However, it was observed that all algorithms struggled to classify the minority class, and results on synthetically balanced data were lower, likely due to the poor quality of the generated data.Clinical relevance-The use of an alternative EHG monitoring technique combined with machine learning can significantly support obstetricians in daily clinical practice, improve the prediction of preterm labor, and minimize complications for both the mother and the fetus.