Machinery diagnostics and prognostics usually involve the prediction process of fault-types and remaining useful life (RUL) of a machine, respectively. The process of developing a data-driven diagnostics and prognostics method involves some fundamental subtasks such as data rebalancing, feature extraction, dimension reduction, and machine learning. In general, the best performing algorithm and the optimal hyper-parameters suitable for each subtask are varied across the characteristics of datasets. Therefore, it is challenging to develop a general diagnostic/prognostic framework that can automatically identify the best subtask algorithms and the optimal involved parameters for a given dataset. To resolve this problem, we propose a new framework based on an ensemble of genetic algorithms (GAs) that can be used for both the fault-type classification and RUL prediction. Our GA is combined with a specific machine-learning method and then tries to select the best algorithm and optimize the involved parameter values in each subtask. In addition, our method constructs an ensemble of various prediction models found by the GAs. Our method was compared to a traditional grid-search over three benchmark datasets of the fault-type classification and the RUL prediction problems and showed a significantly better performance than the latter. Taken together, our framework can be an effective approach for the fault-type and RUL prediction of various machinery systems.