Nowadays, the data-driven diagnosis method, exploiting pattern recognition method to diagnose the fault patterns automatically, achieves much success for rotating machinery. Some popular classification algorithms such as artificial neural networks and support vector machine have been extensively studied and tested with many application cases, while the random forest, one of the present state-of-the-art classifiers based on ensemble learning strategy, is relatively unknown in this field. In this paper, the behavior of random forest for the intelligent diagnosis of rotating machinery is investigated with various features on two datasets. A framework for the comparison of different methods, that is, random forest, extreme learning machine, probabilistic neural network and support vector machine, is presented to find the most efficient one. Random forest has been proven to outperform the comparative classifiers in terms of recognition accuracy, stability and robustness to features, especially with a small training set. Additionally, compared with traditional methods, random forest is not easily influenced by environmental noise. Furthermore, the user-friendly parameters in random forest offer great convenience for practical engineering. These results suggest that random forest is a promising pattern recognition method for the intelligent diagnosis of rotating machinery.