## 4 Expressway PTV Detection Algorithm for Over-the-Horizon
### Section Vehicle Speed Prediction Algorithm
#### 4.4.2 Lightweight Gradient Boosting Machine Learning Model (LightGBM)  
LightGBM is a GBDT algorithm developed by Microsoft, which is a variant of GBDT and is mainly used to solve problems encountered by GBDT when processing large amounts of data. LightGBM adopts a leaf-wise leaf growth strategy with depth constraints, which has low computational cost. By controlling the depth of the tree and the minimum amount of data for each leaf node, overfitting is avoided. As shown in Figure 5, select the leaf with the highest gain from all the current leaves each time for splitting until the gain is less than the given threshold or reaches the depth limit. This strategy can focus more on areas with large errors and improve the accuracy of the model but may lead to overfitting. In order to prevent overfitting, LightGBM has added depth restrictions to the leaf-wise growth strategy, allowing it to better prevent overfitting while maintaining the accuracy of the model. At the same time, LightGBM has chosen a decision tree algorithm based on histogram, which can reduce storage and computing costs. The decision tree algorithm based on histogram is an effective method to reduce data storage and accelerate model calculations. That is, the continuous floating-point eigenvalues are discretization into k integers and a histogram with a width of k. When traversing feature data, the discretization value is used as an index and as the cumulative statistics of the histogram. After traversing once, the histogram can accumulate corresponding statistics, and then search for the optimal splitting point based on the histogram. Through feature discretization, LightGBM can not only reduce storage consumption, but also reduce computing costs, and speed up training through cache hit rate optimization. Therefore, for ETC with a large amount of data and many features, LightGBM has good processing ability. It can be well applied to predict continuous target variables, such as the predicted section vehicle speed in this article. When dealing with this problem, we take the vehicle speed and type in the historical section as the features, and the vehicle speed in the current section as the target variable, and then use the LightGBM model for training and prediction. In addition, the \"vehicle type\" and section features in the data belong to category features, and since LightGBM can directly process these features, this processing ability may bring significant performance improvements on ETC data. The advantage of LightGBM is particularly evident in cases where the category features in the ETC dataset are rich and have a significant impact on model performance. This not only simplifies the workflow of data preprocessing, but also improves the accuracy and efficiency of the model to a certain extent. LightGBM uses a tree-based learning algorithm to form a powerful model by integrating the results of multiple weak learners. These weak learners are usually decision trees. In each iterative learning process, the model seeks a decision tree structure that minimizes the objective function. The objective function is composed of a loss function and regularization term. The loss function measures the gap between the predicted value and the true value of the model. For regression problems, the loss function is usually selected as mean squared error, and the formula is as follows:  
\[\mathrm{L}(\mathrm{y},\mathrm{y}\_\mathrm{v})=\left(\mathrm{y}_{\mathrm{i}}- \mathrm{y}\_\mathrm{v}_{\mathrm{i}}\right)^{2} \tag{5}\]  
where y is the true value and y_v is the predicted value. The regularization term prevents the model from overfitting. For a tree model, the number of leaf nodes and the square sum of leaf node values are often used. The formula is as follows:  
\[\mathrm{\Omega}(\mathrm{f})=\gamma\mathrm{T}+\frac{1}{2}\lambda||\omega||^{2} \tag{6}\]  
where f is the tree model; T is the number of leaf nodes; \(\omega\) is the value of leaf nodes; and \(\gamma\) and \(\lambda\) are the regularization parameters, which can affect the fitting degree of the model.