In this study, most-selective ensemble models are developed to predict the success rate of clinical pregnancy. These models are compared from different aspects of two treatments, IVF/ICSI and IUI.
In this research, we utilized Python and various frameworks, including Scikit-learn, Pandas, and NumPy, to develop, evaluate, and visualize all the models. These tasks were performed in the Google Collaboratory web-based IDE.
In the first step, the results were achieved by each approach, and their criteria in two treatments were compared in terms of accuracy and AUC, as in Fig. 1. Area Under the Curve Operating Characteristic (ROC) curve, which plots the true positive rate (TPR) on the y-axis(AUC), is a performance metric used to evaluate the predictive power of a binary classification model. It is beneficial in situations where the goal is to distinguish between two classes, such as the success rate of clinical pregnancy of treatments, IVF/ICSI, and IUI. The AUC metric is derived from the Receiver and the false positive rate (FPR) on the x-axis as the decision threshold for the classification model is varied. The AUC range is between 0 and 1, with 0.5 representing a random classifier (no predictive power) and 1 representing a perfect classifier (100% accurate). Generally, an AUC value greater than 0.7 indicates a reasonably good model, while an AUC value greater than 0.8 indicates a robust model. Among these models, Bagging and Random Forest accomplished the best mean values of accuracy and AUC for the IVF/ICSI procedure, with Bagging accuracy (0.74) and AUC (0.79) and Random Forest accuracy (0.72) and AUC (0.80). However, for the IUI procedure, the mean accuracy of Bagging and Random Forest is equal to 0.85, and the AUC of Random Forest is higher than that of Bagging; it almost gained better results. Overall, it is observed that Random Forest is a suitable model for two treatments.

Comparison of accuracy and AUC of models in IVF/ICSI and IUI treatment.
In the second step, the value of sperm parameters in predicting the success rate of the clinical pregnancy is illustrated based on the best model (Random Forest) from the previous step. In Fig. 2, the impact of each feature in predicting the model and their relationship are shown for each treatment procedure using Shapley Additive Explanations (SHAP) values. The SHAP value impact on a model plot is a powerful visualization that helps understand the contribution of each feature to the model’s predictions. This plot shows the SHAP values for each feature, ranked by their importance. The bars’ position along the x-axis indicates the direction and magnitude of the feature’s impact. Bars to the right (positive SHAP values) suggest that the feature increases the model’s output. In contrast, bars to the left (negative SHAP values) indicate that the feature decreases the model’s production. Notable, in the IUI procedure, sperm parameters (morphology, motility, and count) had significant negative impacts on clinical pregnancy according to the Random Forest model. However, the coefficient of influence of sperm motility on predicting clinical pregnancy has been reported to be positive for some patients having IVF/ICSI procedures. In contrast, the morphology and count factors had negative impacts.

Impact of Sperm parameters on RF model prediction in IVF/ICSI and IUI.procedures.
In addition, the statistical results of the association between sperm parameters and pregnancy are shown in Fig. 3.
Figure 3 also includes a box plot that visually represents the distribution of sperm parameters in the successful and unsuccessful pregnancy groups. The box in the figure indicates the interquartile range (IQR), which encompasses the middle 50% of the data, with the line inside the box representing the median. The whiskers extend to the minimum and maximum values within 1.5 times the IQR of the first and third quartiles, respectively. At the same time, any data points outside this range are considered outliers and are plotted individually.
In this figure, the differences between the values of sperm parameters in the successful and unsuccessful pregnancy groups were evaluated using Student’s t-test. The results showed that in clinical pregnancies after the IVF/ICSI procedure, there was a significant difference in sperm morphology and number between the successful and unsuccessful groups (p-value < 0.05). Specifically, the morphological parameter significantly differed in both pregnancy outcomes in the IUI procedure. In contrast, the count parameter did not differ substantially between the successful and unsuccessful groups.
These detailed statistical analyses underscore the significant associations between specific sperm parameters and pregnancy outcomes, highlighting the importance of morphology in predicting success in both IVF/ICSI and IUI procedures.


Correlation of sperm parameters with CPR as clinical pregnancy rate and FHR as fetal heart rate for IUI and IVF/ICSI.
Determining a cut-off value for the feature can provide valuable information for gynecologists. In this study, for each of these sperm parameters, a cut-off was computed to derive an evidence-based decision rule. Hence, a contingency table evaluated the validity of the results. For CPR purposes, the optimal sperm count parameter cut-offs were 54 million per ml after sperm selection (p-value: 0.02, 95%-CIs: 1.05–2.13) and 35 (p-value: 0.03, 95%-CIs: 1.06–2.86) in IVF/ICSI and IUI procedures, respectively. The cut-off point for the morphological parameter in each of the procedures approach was also found to be 30 million per ml after sperm selection with a p-value of 0.05. However, no significant cut-off for the motility factor was obtained for the methods. The cut-offs were also investigated for FHR, and the results were similar to those of CPR.
Additionally, statistical information about sperm parameters in different courses for two methods is provided based on the WHO recommendation 8. From the results obtained in Tables 1 and 2, it can be seen that most of the patients in the two procedures were in the first course of the procedure. The results showed the fact that in the IVF/ICSI groups for most patients in the first and second course of the procedure, sperm parameters are below average set by WHO. However, in the IUI group, sperm parameters report a higher-than-average level (Table 2). Furthermore, for patients with sperm parameters above the mean value reported by WHO, the IUI method reached better results, and the two courses of procedure were more successful. Moreover, for patients whose sperm parameters are below average, IVF procedures achieved better results. Especially for the second course of procedure, they achieved higher success rates in CPR and FHR.

