## 4 Expressway PTV Detection Algorithm for Over-the-Horizon
### Section Vehicle Speed Prediction Algorithm
#### 4.4.2 Lightweight Gradient Boosting Machine Learning Model (LightGBM)
Therefore, the objective function can be written as:  
\[\mathrm{Obj}(\mathrm{f})=\sum_{\mathrm{i}}\mathrm{L}(\mathrm{y}_{\mathrm{i}},\mathrm{y}\_\mathrm{v}_{\mathrm{i}})+\sum_{\mathrm{k}}\mathrm{\Omega}( \mathrm{f}_{\mathrm{k}}) \tag{7}\]  
Figure 5: Decision tree strategy by leaf growth. Finally, in order to optimize the performance of the model, we used a Python-based Hyperopt module to perform Bayesian optimization. This method gradually adjusts and narrows the parameter space based on the feedback information of the objective function, thereby efficiently searching and optimizing multiple parameters globally. In this way, we can determine a set of optimization parameters that can maximize overall performance. This method elevates the optimization process of traditional grid search and random search to a new level, making parameter adjustment more intelligent and efficient, thus enabling the optimal model configuration to be found in complex parameter spaces. The overall section vehicle speed prediction algorithm is implemented as follows (Algorithm 3):  
```
Input: vehicle history section travel time: T [], vehicle travel speed: Vcar [], vehicle type: veh [], section distance: Dis []: Output: Vehicles in transit section travelling speed: Vpre;
1. data = load_data(filepath) //import data;
2. denoised_data = wavelet_denoised(data) #Noise the data using the WT;
3. X_train, X_test, y_train, y_test = train_test_split(denoised_data) #Split the test set and the training set for the denoised data;
4. PARA= hyperopt(parameters) #Bayesian optimisation of parameters using hyperopt module;
5. model = lgb.LGBMRegressor() # Logic to build the LightGBM model;
6. train_model(model, X_train, y_train) # train the model;
7. predictions = predict(model, X_test) # predict data;
8. print(predictions) #Output predictions
```  
**Algorithm 3**Speed prediction algorithm for section vehicles  
The main objective of the algorithm is to predict the traffic speed of vehicles within a section, based on information including the traffic speed of vehicles on the historical road section, vehicle type, and road distance. First, in order to accurately capture the change of vehicle speed and eliminate the impact of noise, we use WT to denoise the original data. Next, we divided the processed data into a training set and a test set in an 8:2 ratio, and the training set data was used to train the LightGBM model. During the model training process, in order to find the optimal model parameter configuration, we adopted a Bayesian optimization strategy based on the hyperopt module. Through this adaptive parameter search strategy, the model can find the optimal parameter combination in a multi-dimensional parameter space, thereby improving the prediction accuracy of the model. Finally, the optimized model is used to predict the traffic speed of vehicles in the test set within the section. Our method realizes accurate prediction of vehicle speed by comprehensively using historical driving data, vehicle types, and road distance information, and provides an important decision-making basis for vehicle scheduling and management in intelligent transportation systems.