Everyone aspires to live a healthy life, but many will inevitably experience some form of disease, illness, or accident that results in disability at some point. Rehabilitation plays a crucial role in helping individuals recover from these disabilities and return to their daily activities. Traditional rehabilitation methods are often expensive, are inefficient, and lead to slow progress for patients. However, in this era of technology, various sensor-based automatic rehabilitation is also possible. A Kinect sensor is a skeletal tracking device that captures human motions and gestures. It can provide feedback to the users, allowing them to better understand their progress and adjust their movements accordingly. In this study, stroke-based rehabilitation is presented along with the Toronto Rehab Stroke Pose Dataset (TRSP). Pre-processing of the raw dataset was performed using various features, and several state-of-the-art classifiers were applied to evaluate the data provided by the Kinect sensor. Among the various classifiers, eXtreme Gradient Boosing (XGB) attained the maximum accuracy of 92% for the TRSP dataset. Furthermore, hyperparameters of the XGB have been optimized using a metaheuristic gray wolf optimizer for better performance.