###### Abstract
In addition, FC can be used for both diagnostics and prognostics since it allows constructing features according to specific criteria to satisfy, e.g., similarity and monotonicity [17]. Genetic Programming (GP) represents an effective tool for FC. It automatically selects and constructs more discriminating features without requiring a pre-defined model and a high amount of training data [18]. Feature selection and construction are performed according to a fitness function, which can be designed depending on the objective of the analysis, e.g., classification, clustering, and regression. This paper uses GP to construct feature sets for two distinct goals, i.e., system setting detection and prognostics. System setting detection aims to recognize the specific operating condition under which the system is working. An optimal prognostics model, and therefore an optimal HI, should be insensitive to the implemented setting. However, industrial data are often unlabelled and not provided with contextual information, especially if the perspective of a machine producer is assumed [19]. These characteristics make it necessary to detect a change in the system setting to understand, for instance, that a different trend in the extracted feature does not correspond to a component fault. Like diagnostics, system setting detection is a pattern recognition problem and, therefore, can be faced through classification and clustering ML algorithms [20]. Since not all machinery settings may be known at the time of the analysis, two distinct GPs are built for the setting recognition goal in this paper. The first GP uses a supervised algorithm, i.e., the k-Nearest Neighbor (k-NN), to evaluate the feature constructed at each iteration; therefore, the label indicating the system setting is used during the assessment process. The second GP uses the k-Means algorithm, which adopts an unsupervised learning approach and does not require any information on the implemented setting. Both GPs provide one only feature, which should be as constant as possible within the same class/cluster since not influenced by the single component behaviors. The performances of constructed features are evaluated in terms of the classification accuracy obtained by two ML supervised algorithms, i.e., the DecisionTree (DT) and the k-NN. Finally, a third GP is built for the prognostics goal. It provides a component-level Health Indicator (HI) that describes the components' degradation process. The HI should have a clear trend and similar values at the end of the components' life, i.e., similar Failure Thresholds (FT). To this aim, a multi-criteria fitness function considering monotonicity, trendability, and prognosability is used to assess the constructed HI. The proposed GP models are applied to vibration signals collected from a test rig built in the Department of Industrial Engineering of the University of Bologna. The main contributions of this paper can be summarized as follows. First, FC is performed to build two distinct features, one identifying the system setting and the other one describing the failure progression at a component level. Hence, a simultaneous analysis at a system and component level is conducted. Second, to the best of our knowledge, it is the first time that a clustering-based fitness function for system setting recognition is included in the GP in the prognostics field. The remaining of this paper is organized as follows. Section 2 reviews the existing literature about GP-based FC for diagnostics and prognostics. In Section 3, the theoretical background and critical elements of GP are described. In addition, the adopted fitness functions for setting detection and prognostics are described. Finally, a case study shows the application of the developed GPs to vibration signals collected during several run-to-failure tests.