Accurate prediction of remaining useful life (RUL) plays an important role in the formulation of maintenance strategies. However, due to the diversity of the failure mode of equipment, there are significant differences between the degradation data, which greatly affects the accuracy of RUL prediction. In this case, an ensemble prediction model considering health index-based (HI-based) classification is proposed in this paper. Firstly, the stacked autoencoder (SAE) is employed to construct the HI. Then, the time window is used to sequentially process the HI sequence, so that many data segments with the same length can be achieved. To differentiate the data with the similar degradation process, K-means and Xgboost are selected to construct offline and online data classification models respectively. Finally, according to the results of the data classification, the ensemble model that integrates multiple machine learning methods are separately trained and then adaptively used for RUL prediction. In addition, integrating multiple methods helps to improve the generalization ability of the model. The NASA C-MAPSS dataset is applied to verify the effectiveness of the proposed method, and the results show that the proposed method achieves a higher prediction accuracy and shorter computational time than other existing prediction models.