# Optimization of Sensor Placement for Modal Testing Using Machine Learning
## 3 Machine Learning Approach for Sensor Selection
In Figure 1, input b has a feature importance of 0.6, input d has a feature importance of 0.2, input a has a feature importance of 0.15, and input c has a feature importance of 0.05. Therefore, input b is the most important feature and represents 60% of the variance in the data. Input d is the second most important feature and represents 20% of the variance in the data. Inputs b and d combined represent 80% of the variance in the data and could be used as a reduced model of the system. Figure 1: Conceptual representation of the random forest feature selection approach. This concept can be applied to sensor placement and selection by defining all the possible locations and types of sensors in the system as input variables [34]. The optimal number, location, and type of sensors are determined based on the most important features selected by the random forest regressor. A flow-chart of the approach is shown in Figure 2.  
First, a finite element (FE) model of the system is created, and a broadband time-domain simulation in the frequency domain of interest is performed. The results of the simulation are exported for each node and/or potential sensor locations. These locations must correspond to all the possible/viable locations for the sensors in the modal tests. All quantities corresponding to the desired sensors should be considered, such as strains, accelerations, etc. For each of these \(n\) locations and quantities, the frequency response function (FRF) is evaluated. FRF is defined as the ratio of the response (i.e., acceleration, velocity, or displacement) with respect to the excitation force, which is the reference. These quantities will be the inputs of the machine learning model. Then, a scalar parameter that represents the global behavior of the system should be identified for each frequency at which the input FRFs are evaluated. This parameter will be used as output for the random forest feature importance approach. Three different options for output parameters are evaluated in this paper: the raw Operational Deflection Shape (ODS), the normalized ODS, and the average FRF. 1. Global parameter (a): raw ODS. The sum of the squares of the ODS at each possible sensor location is evaluated according to  
\[\text{Output a}=ODS_{\omega}^{T}ODS_{\omega} \tag{19}\]  
where \(ODS_{\omega}\) contains the operational deformed shape at each frequency \(\omega\). This expression results in a distinct scalar value for each ODS at each frequency. Output a, however, depends on the load condition of the beam and will change depending on the magnitude of the load applied to the beam. 2. Global parameter (b): normalized ODS. To decrease the sensitivity of the output to the load conditions, a normalized form of output \(a\) is calculated as follows:  
Figure 2: Flow-chart of the proposed approach. \[\text{Output b}=\frac{ODS_{u}^{\text{T}}ODS_{\omega}}{\left|ODS_{\omega}\right|^{2}} \tag{20}\]  
Dividing the ODS product by the magnitude of the ODS at that frequency reduces the effect of the external load on the output used by the random forest feature importance approach and, therefore, on the sensor placement. 3. Global parameter (c): average FRF. The last output chosen was the average FRF at a given frequency, where n is the number of nodes, and the sum of the FRF at a given frequency is taken across all nodes \(n\). \[\text{Output c}=\frac{\sum FRF(f)}{n} \tag{21}\]  
After all local and global quantities are evaluated, the database can be created according to Table 1. The first column contains the frequency, columns 2 to (n + 1) contain the FRF at each desired location and represent the input variable, and the last column (n + 2) contains the global parameter and will be the output quantity for the random forest regressor. The random forest method can be run to obtain the ranking of the most important features, which can then be selected as the location and type of sensor needed for modal testing.