Stroke is a serious brain dysfunction disease that occurs when blood flow to the brain suddenly stops due to blockage or rupture of blood vessels. This disease is very dangerous and life-threatening. Early detection of stroke symptoms is very important to predict and prevent long-term impacts because it can save lives. Among the early detection efforts is using the Random Forest method in machine learning to predict stroke and successfully achieving 94% accuracy. This study proposes optimization of preprocessing / data preparation with interference of missing value handlers in the stroke prediction model using KNNImputer. The result is that the Random Forest method is able to improve the accuracy performance from initially having an accuracy value of 94% to between 95% - 96%. In addition, it also reduces the standard deviation or standard deviation of the Random Forest model. However, the strategy for the sequence of work between missing value handlers and categorical feature transformations does not affect the performance of the Random Forest model.