ABSTRACT: Rate of Penetration (ROP) estimation is a key parameter in drilling optimization, due to its role in minimizing drilling costs. Several ROP models have been developed which can predict the penetration rate based on physics-based or data-driven techniques. Considering a data-driven approach, the purpose of this research is to apply a Machine Learning (ML) algorithm named Ensemble Bagged Trees to predict the rate of penetration (ROP) in formations based on data of weight on bit (WOB), rotary speed (RPM), torque and measured depth. In this study, a large well segment in Iran has been analyzed in which there is no information break throughout the segment. Based on the achieved high accuracy, it is concluded that proposed machine learning algorithm is a very useful and good predictor of rate of penetration through wellbore. The parameters to evaluate the accuracy of the model were mean squared error and correlation coefficient on the testing data.