DOI: 10.3390/ani16162563 ISSN: 2076-2615

Predicting Pregnancy After Fixed-Time Artificial Insemination in Goats: Comparative Performance of Multivariable Logistic Regression and Random Forest Models

Aníbal Rodríguez-Vargas, Josselin Rivas-Flores, José Ruiz-Chamorro, Gerardo Galván-Cavero, Gilmar Mendoza-Ordoñez, Narda Ortiz-Morera, Juancarlos Cruz-Luis

Accurate prediction of pregnancy following fixed-time artificial insemination (FTAI) remains challenging under commercial goat production conditions. This study compared multivariable logistic regression and Random Forest models for pregnancy prediction and used SHAP analysis to characterize predictor contributions. Data from 920 goats subjected to FTAI across four regions of Peru were analyzed using reproductive, hormonal, animal-level, and management variables. Logistic regression was developed after univariable screening, whereas Random Forest models used 500 trees with mtry values of 2, 3, and 4. Models were compared using stratified 10-fold cross-validation with identical folds. The mtry = 4 configuration yielded the highest Random Forest AUC. Logistic regression identified semen type, buck and doe breed, insemination site, and cervical mucus score as independent predictors. Chilled semen was associated with higher pregnancy odds, whereas superficial cervical insemination was associated with lower odds. Logistic regression outperformed Random Forest in discrimination (AUC, 0.761 vs. 0.654), accuracy (0.679 vs. 0.644), and specificity (0.882 vs. 0.782), whereas Random Forest showed higher sensitivity (0.369 vs. 0.278). SHAP analysis identified eCG dose, cervical mucus score, semen type, and insemination site as the most influential predictors. Overall, logistic regression provided superior and more consistent predictive performance, whereas Random Forest offered complementary sensitivity and captured nonlinear predictor contributions. These findings support logistic regression as the more effective predictive approach for pregnancy following FTAI under the conditions studied, with explainable machine learning providing complementary insight into prediction patterns.

More from our Archive