For a study, researchers sought to create machine-learning (ML) classifiers for predicting prolonged intensive care unit (ICU) and hospital stays in critically ill patients with spinal cord injuries (SCI). The study comprised 1,599 critical patients with SCI who were classified as having an extended or normal stay. The Medical Information Mart for Intensive Care III-IV Database and the eICU Collaborative Research Database retrieved all data. Training, validation, and testing (6:2:2) sub-datasets were created randomly from the retrieved data. A total of 91 initial ML classifiers were created, with the top 3 performing classifiers stacked into an ensemble classifier with a logistic regressor. The area under the curve (AUC) was used to evaluate the performance of all classifiers in terms of prediction. Prolonged ICU stay was the primary predictive outcome, while prolonged hospital stay was the secondary outcome. The AUC of the ensemble classifier in predicting prolonged ICU stay was somewhere between 0.864±0.021 in 3-time 5-fold cross-validation and 0.802 in independent testing. The AUC of the ensemble classifier in predicting prolonged hospital stays was somewhere between 0.815±0.037 in 3-time 5-fold cross-validation and 0.799 in independent testing. The top 3 initial classifiers’ curves varied a lot in either predicting prolonged ICU stay or discriminating prolonged hospital stay, demonstrating the benefits of the ensemble classifiers. The ensemble classifiers correctly predicted a prolonged ICU stay and a prolonged hospital stay, indicating that they had great potential for supporting clinicians in treating SCI patients in the ICU and maximizing medical resources.