## 4 Establishment of a Prediction Model for Dual-Mode Shield Tunneling Parameters
### Data Preprocessing
#### 4.2.2 Outlier Handling  
In practical scenarios, equipment monitoring generates a large amount of data, and monitoring anomalies may inevitably lead to some outlier values. For such data, commonly used outlier detection methods are employed for exclusion. This study utilizes the Isolation Forest algorithm for identifying and detecting anomalous data. The Isolation Forest algorithm was jointly proposed by Professor [PERSON] and others in 2008 [27] for data mining. It is an unsupervised anomaly detection algorithm suitable for continuous data anomaly detection. Specifically, the Isolation Forest algorithm randomly partitions the data into several subspaces, constructs a set of binary search trees based on random partitions, and inserts data points into the leaf nodes. It determines whether a data point is an outlier by calculating the average path length across all trees for each data point. A shorter path length indicates that the data point is more easily isolated, making it more likely to be an outlier. The isolated forest model is shown in Figure 4.  
Figure 4: Isolated forest model. Figure 3: Raw data. The specific numerical expression is given by the following Formula (6). Firstly, construct \(h(x)\) as a metric to measure the \"isolation degree\" of a data point (sample) from other data points. It is defined as the path length that a data point traverses from the root node to that point on a random tree. For a random tree \(T\) and a data point \(x\) within it, the number of samples that share the same leaf node with \(x\) in \(T\) is denoted as \(T.size(x)\). Subsequently, for a given \(T.size(x)\), a correction term \(c(T.size(x))\) can be calculated to represent the average path length of constructing a binary tree with \(T.size(x)\) samples. \[h(x)=e+c(T.size), \tag{6}\]  
The second step involves constructing the average path length \(c(n)\) of a binary tree using \(n\) samples, specifically based on a Binary Search Tree (BST). This metric represents the average distance between any two nodes in a BST with n elements. The average path length \(c(n)\) can be calculated using the following formula:  
\[c(n)=2[H(n)-1]-2\frac{n-q(n)-1}{n}, \tag{7}\]  
Here, \(H(n)\) represents the average path length of a BST with a height of \(n\), and \(q(n)\) is an estimation of the number of non-leaf nodes in the BST after randomly constructing and inserting n elements. \[s(x,n)=2^{-\frac{E(h(x))}{c(n)}}, \tag{8}\]  
Finally, a normalization process is applied to map the range of \(h(x)\) to between 0 and 1. Here, \(h(x)\) represents the path length of sample point \(x\), and \(S(x,n)\) is the anomaly index of the tree, which records the training data of \(x\) in \(n\) samples. From this formula, it can be observed that as the path length decreases, \(s\) approaches 1, and the probability of detecting the sample point as an anomaly increases. Compared to commonly used calculation methods such as Mahalanobis distance and the \(3\sigma\) criterion, the Isolation Forest algorithm does not require calculating anomaly standards for data under different geological conditions. Its unsupervised, efficient, and precise advantages make it more suitable for extensive data processing in industries such as tunnel boring machines (TBM). The Isolation Forest algorithm is capable of handling high-dimensional data. However, an increase in data dimensions during processing increases tree depth, resulting in higher time complexity for tree construction and search. Additionally, greater tree depth increases sensitivity to anomalies, making them more prone to be classified as outliers. Considering the focus of this study on predicting the tedious tunnel process's advance rate, the advance rate is paired with the total thrust, thrust pressure, cutterhead torque, and cutterhead speed to form a two-dimensional array. This array is then cyclically fed into the model for training, with all identified anomalies marked after training completion. Finally, the rows containing anomalies are removed.