In recent years, the fusion of the medical and computer science domains has gained significant traction in the scientific research landscape. Progress in both fields has enabled the generation of a vast amount of data used for making predictions and identifying interesting clusters and pathways. The Machine Learning model's application in the medical domain is one of the most compelling and challenging topics to explore, bridging the gap between Artificial Intelligence (AI). and healthcare. The combination of AI and medical information offers the possibility to create tools that can benefit both healthcare providers and physicians. This enables the enhancement of rehabilitation therapy and patient care. In the rehabilitation context, this work provides an alternative perspective: prediction of patients’ home discharge upon completing the rehabilitation protocol. Demographic and clinical data were collected on 7282 inpatients from electronic Medical Record, each record was categorized into Neurological Patients (NP, N = 3222) or Orthopedic Patients (OP, N = 4060). To comprehend the most suitable machine learning model, an extensive data preprocessing phase was essential. This included steps such as variable recoding, scaling, and comparing various dataset balancing methods to enhance the model’s performance. Random Forest model was selected after a careful review and comparison of algorithms commonly utilized in the clinical-rehabilitative domain. Following a significant hyperparameter optimization phase through a grid search technique, we achieved an accuracy rate of 97% for OP and slightly lower (94%) for NP. This work points out the increasing importance of AI in medicine, especially in the realm of personalized rehabilitation. The use of such approaches could signify a transformative shift in healthcare. The integration of machine learning not only enhances the precision of treatment but also opens new possibilities for patient-centered care, improving outcomes and quality of care for individuals undergoing rehabilitation.