Background: The importance of being physically active and avoiding staying in bed has been recognized in stroke rehabilitation. However, studies have pointed out that stroke patients admitted to rehabilitation units often spend most of their day immobile and inactive, with limited opportunities for activity outside their bedrooms. To address this issue, it is necessary to record the duration of stroke patients staying in their bedrooms, but it is impractical for medical providers to do this manually during their daily work of providing care. Although an automated approach using wearable devices and access points is more practical, implementing these access points into medical facilities is costly. However, when combined with machine learning, predicting the duration of stroke patients staying in their bedrooms is possible with reduced cost. We assessed using machine learning to estimate bedroom-stay duration using activity data recorded with wearable devices.Method: We recruited 99 stroke hemiparesis inpatients and conducted 343 measurements. Data on electrocardiograms and chest acceleration were measured using a wearable device, and the location name of the access point that detected the signal of the device was recorded. We first investigated the correlation between bedroom-stay duration measured from the access point as the objective variable and activity data measured with a wearable device and demographic information as explanatory variables. To evaluate the duration predictability, we then compared machine-learning models commonly used in medical studies.Results: We conducted 228 measurements that surpassed a 90% data-acquisition rate using Bluetooth Low Energy. Among the explanatory variables, the period spent reclining and sitting/standing were correlated with bedroom-stay duration (Spearman’s rank correlation coefficient (R) of 0.56 and −0.52, p < 0.001). Interestingly, the sum of the motor and cognitive categories of the functional independence measure, clinical indicators of the abilities of stroke patients, lacked correlation. The correlation between the actual bedroom-stay duration and predicted one using machine-learning models resulted in an R of 0.72 and p < 0.001, suggesting the possibility of predicting bedroom-stay duration from activity data and demographics.Conclusion: Wearable devices, coupled with machine learning, can predict the duration of patients staying in their bedrooms. Once trained, the machine-learning model can predict without continuously tracking the actual location, enabling more cost-effective and privacy-centric future measurements.