Researchers created a machine learning-based system for predicting mortality risk to overcome difficulties in choosing suitable participants for clinical trials conducted in the Intensive Care Unit (ICU). This algorithm combines Red blood cell Distribution Width (RDW) information with various demographic factors to forecast ICU mortality, working together with established ICU mortality scoring tools such as the Simplified Acute Physiology Score (SAPS). The present study introduces a machine learning-based prognostic scoring system for mortality that integrates RDW with other readily obtainable patient variables in the ICU. The new algorithm, called Mixed-effects logistic Random Forest for binary data (MixRFb), combines Random Forest (RF) classification with a mixed-effects model tailored for binary outcomes while properly handling repeated measurements. Comparisons of performance were made between standard RF and the new MixRFb approaches that used only SAPS scoring, supplemented by a descriptive receiver operating characteristic curve assessing RDW’s capacity to predict mortality. When RDW and other covariates were included, the MixRFb model performed better than the version based solely on SAPS, delivering an area under the curve of 0.882 instead of 0.814. Variable importance plot analysis revealed that age and RDW were the strongest predictors of ICU mortality. The MixRFb algorithm is more effective at forecasting in-hospital mortality and identifies age and RDW as the key predictive factors. Using this tool could streamline participant selection for clinical trials, leading to stronger trial results and better adherence to ethical principles. Subsequent studies should prioritize making the algorithm more robust, extending its applicability across a wider range of clinical environments and patient populations, and adding additional predictive variables to enhance the precision of patient selection.