Expressway traffic volume prediction method, system and device based on random forest model and medium

By employing a random forest model in traffic volume prediction, and utilizing feature selection and parameter optimization, the limitations of traditional models in terms of accuracy and adaptability are overcome, achieving higher accuracy and more stable traffic volume prediction.

CN121838451APending Publication Date: 2026-04-10SHANGHAI INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI INST OF TECH
Filing Date
2025-11-27
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional traffic volume prediction methods, such as grey system theory models, have limitations in prediction accuracy and adaptability. Random forest models have not been fully optimized for traffic volume prediction. How to improve prediction accuracy and adaptability has become an urgent problem to be solved.

Method used

Through feature selection, data preprocessing, model building, and parameter optimization, a random forest model is used to predict highway traffic volume. The model parameters are optimized using key feature variables and grid search strategy, and fine-tuned using the control variable method. The prediction accuracy is evaluated using MAE, RMSE, and relative error indices.

Benefits of technology

It improves the accuracy and stability of highway traffic volume prediction, enhances the model's adaptability and predictive ability, and is significantly superior to traditional grey system theory models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121838451A_ABST
    Figure CN121838451A_ABST
Patent Text Reader

Abstract

The invention discloses an expressway traffic volume prediction method, system and device based on a random forest model and a medium, and belongs to the technical field of traffic volume prediction.The expressway traffic volume prediction method comprises the steps that an expressway section in a research area is selected, and traffic flow data in a designated time range in the research area is obtained; according to traffic flow data, after cleaning and normalization processing are adopted, key feature variables are screened through correlation between features and target variables, a random forest prediction model is constructed based on the selected features, model structure parameters are set, and key parameters of the model are adjusted and optimized in combination with a control variable method and a grid search strategy. The traffic flow prediction of each road section of the expressway is realized; and according to traffic flow prediction, performing precision evaluation on a prediction result by adopting a prediction precision evaluation index. The method can effectively solve the problem of improving the traffic volume prediction precision, can scientifically predict the historical or future traffic volume, and provides a new thought for improving the traffic volume prediction precision.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of traffic volume prediction, in particular to a highway traffic volume prediction method, system, device and medium based on a random forest model. BACKGROUND

[0002] Traffic volume prediction is an important link in traffic planning and management, and has important significance for improving road use efficiency and relieving traffic congestion. Traditional traffic volume prediction methods, such as gray system theory model, can achieve prediction to some extent, but their prediction accuracy and adaptability still have limitations. With the development of big data and machine learning technology, the random forest model has great potential in the field of traffic volume prediction due to its strong nonlinear fitting ability and anti-overfitting characteristics.

[0003] Currently, the application of random forest model in traffic volume prediction is still in the exploratory stage. How to optimize model parameters, improve prediction accuracy, and effectively process traffic volume data and its influencing factors have become urgent problems to be solved. The present application proposes a traffic volume prediction method based on a random forest model to achieve high-precision prediction of traffic volume through feature selection, data preprocessing, model construction and parameter optimization. SUMMARY

[0004] In view of the above problems, the present application provides a highway traffic volume prediction method, system, device and medium based on a random forest model.

[0005] Therefore, the technical problem solved by the present application is how to solve the problem that traditional traffic volume prediction methods, such as gray system theory model, can achieve prediction to some extent, but their prediction accuracy and adaptability still have limitations. With the development of big data and machine learning technology, the random forest model has great potential in the field of traffic volume prediction due to its strong nonlinear fitting ability and anti-overfitting characteristics.

[0006] To solve the above technical problems, the present application provides the following technical scheme: a highway traffic volume prediction method based on a random forest model, which includes selecting a highway section in a study area, obtaining traffic flow data in a specified time range in the study area; based on the traffic flow data, after cleaning and normalization, key feature variables are selected between the correlation of features and target variables, a random forest prediction model is constructed based on the selected features, model structure parameters are set, and key parameters of the model are optimized by combining control variable method and grid search strategy, traffic flow prediction of each section of the highway is realized; based on the traffic flow prediction, the prediction accuracy evaluation index is used to evaluate the accuracy of the prediction result.

[0007] As a preferred scheme of the expressway traffic volume prediction method based on the random forest model, wherein: the selected expressway section in the research area, the traffic flow data in the specified time range of the research area is obtained, including collecting traffic flow data and influence factor data; the data is cleaned and normalized; the data set is divided into training set, validation set and test set.

[0008] As a preferred scheme of the expressway traffic volume prediction method based on the random forest model, wherein: according to the traffic flow data, after cleaning and normalization, the key feature variables are screened according to the correlation between the features and the target variables, the random forest prediction model is constructed based on the selected features, the model structure parameters are set, and the model key parameters are optimized combined with the control variable method and the grid search strategy, the traffic flow of each section of the expressway is predicted, including: four key feature variables are screened according to the linear relationship strength between the features and the target variables, and finally the input of model construction is obtained; based on the selected features, the traffic flow prediction model is constructed by using the random forest algorithm.

[0009] As a preferred scheme of the expressway traffic volume prediction method based on the random forest model, wherein: according to the linear relationship strength between the features and the target variables, four key feature variables are screened, and finally the input of model construction is obtained, including: using SelectKBest method in Scikit-Learn, combining f_regression for feature selection, screening key features according to the linear relationship strength between the features and the target variables, and obtaining the correlation scores of each feature through selector.scores_; the most important features are determined according to the feature importance scores as the input of model construction.

[0010] As a preferred scheme of the expressway traffic volume prediction method based on the random forest model, wherein: according to the feature importance score, the most important features are determined as the input of model construction, including four core feature variables of population, highway freight volume, GDP and motor vehicle ownership; based on the selected features, the traffic flow prediction model is constructed by using the random forest algorithm, including: the traffic flow prediction model is constructed by using the random forest algorithm, and the key parameters of the model are optimized and adjusted by the grid search method to determine the best parameter combination.

[0011] The preferred scheme determines population, highway freight volume, GDP and motor vehicle ownership as model input features, so that the model input structure is more representative, which helps to improve the stability of model prediction; the random forest model constructed combined with the optimal parameter combination can realize more accurate traffic volume prediction under multi-feature input.

[0012] As a preferred embodiment of the highway traffic volume prediction method based on the random forest model described in this invention, the step of evaluating the accuracy of the prediction results based on traffic flow prediction using prediction accuracy evaluation indicators includes evaluating the prediction performance of the model using MAE, RMSE, and relative error indicators.

[0013] This preferred scheme uses three evaluation indicators: MAE, RMSE, and relative error, which can reflect the deviation of the prediction results from different perspectives, making the model performance evaluation more comprehensive. Combined with the grey system time response equation for calculation, it can realize the interpretability analysis of the model prediction process.

[0014] As a preferred embodiment of the highway traffic volume prediction method based on the random forest model described in this invention, the following steps are included: constructing a traffic flow prediction model using the random forest algorithm and optimizing and tuning the key parameters of the model using a grid search method to determine the optimal parameter combination. This includes setting random forest algorithm parameters during the modeling process; studying the impact of each parameter on the model, setting four parameters using the control variable method to obtain the impact of each parameter on the model, resulting in four parameter combinations; using the grid search method to fine-tune these four parameter combinations and employing 10-fold cross-validation to obtain two optimal parameter combinations.

[0015] This preferred approach combines the control variable method with grid search for parameter tuning, which can effectively identify the impact of model parameters on prediction performance and obtain a more reasonable parameter configuration, making the overall performance of the random forest model more stable after training.

[0016] This invention provides a highway traffic volume prediction system based on a random forest model.

[0017] To address the aforementioned technical problems, this invention provides the following technical solution: a highway traffic volume prediction system based on a random forest model, comprising: a data acquisition module, a prediction module, and an evaluation and comparison module; the data acquisition module is used to select highway sections within a study area and acquire traffic flow data within a specified time range within the study area; the prediction module is used to, based on the traffic flow data, perform cleaning and normalization processing, filter key feature variables through the correlation between features and target variables, construct a random forest prediction model based on the selected features, set model structure parameters, and optimize the key parameters of the model using a control variable method and a grid search strategy to achieve traffic flow prediction for each highway section; the evaluation and comparison module is used to evaluate the accuracy of the prediction results based on the traffic flow prediction using prediction accuracy evaluation indicators.

[0018] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the highway traffic volume prediction method based on a random forest model.

[0019] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the highway traffic volume prediction method based on a random forest model.

[0020] The beneficial effects of this invention are as follows: This invention solves the problem of low prediction accuracy in traditional traffic volume prediction methods, thereby improving prediction accuracy. This invention can effectively address the issue of improving traffic volume prediction accuracy, enabling scientific prediction of historical or future traffic volumes, and providing a new approach to improving traffic volume prediction accuracy. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 The above is a flowchart of a highway traffic volume prediction method based on a random forest model, which is provided as an embodiment of the present invention. Detailed Implementation

[0023] To make the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0024] Example 1, referring to Figure 1 This is one embodiment of the present invention, which provides a method for predicting highway traffic volume based on a random forest model, including: S1. Select a highway section in the study area and obtain traffic flow data for the specified time range in the study area.

[0025] S2. Based on traffic flow data, after cleaning and normalization, key feature variables are selected by the correlation between features and target variables. A random forest prediction model is constructed based on the selected features, the model structure parameters are set, and the key parameters of the model are optimized by combining the control variable method and grid search strategy to achieve traffic flow prediction for each section of the highway.

[0026] S3. Based on traffic flow forecasts, the forecast accuracy evaluation index is used to assess the accuracy of the forecast results.

[0027] This embodiment constructs a highway traffic volume modeling and prediction process through steps S1-S3, which can predict traffic flow on a specified highway segment and analyze the prediction accuracy. It has completeness and feasibility, and provides basic support for subsequent model selection and parameter optimization.

[0028] Example 2, an embodiment of the present invention, provides a highway traffic volume prediction method based on a random forest model, based on the previous embodiment, including: In this application embodiment, the traffic flow data in step S1 can be historical traffic flow data collected from 16 typical road sections of a highway in a certain area within a specified time range, including traffic flow statistics for each road section.

[0029] In one alternative implementation, traffic flow data can also be dynamic traffic operation indicators such as average vehicle speed and traffic density over a specified period of time, automatically recorded by a traffic monitoring system.

[0030] In another alternative implementation, traffic flow data can also be a combination of historical traffic records and high-frequency real-time traffic data provided by third-party platforms, used to expand sample dimensions and improve model generalization ability.

[0031] This invention acquires and processes traffic flow data from typical sections of the Dongguan-Shenzhen Expressway, making the model stable and representative in terms of input data quality, which helps to improve the accuracy and reliability of the model's prediction results.

[0032] Furthermore, in step S1, a highway segment within the study area is selected, and traffic flow data for a specified time range within the study area is obtained, including the following steps A1-A3: A1. Collect traffic flow data and influencing factor data.

[0033] A2. Clean and normalize the data.

[0034] A3. Divide the dataset into training set, validation set and test set.

[0035] In this embodiment of the application, the influencing factor data in step A1 can be four characteristic variables related to highway traffic flow: population, highway freight volume, GDP, and motor vehicle ownership, which have a significant impact on traffic volume changes.

[0036] In one alternative implementation, the influencing factor data can also be urban development indicators extracted from historical statistical data, such as urbanization rate and regional fixed asset investment scale, to assist in the analysis of traffic flow change trends from a macro perspective.

[0037] In another alternative implementation, the influencing factor data can also be information reflecting road use behavior, such as the number of permits issued, road network traffic levels, and holiday work schedule adjustments from the traffic management system, to enhance the interpretability of the model's input features.

[0038] This invention uses data on factors closely related to traffic volume, such as population, highway freight volume, GDP, and motor vehicle ownership, as model inputs. This helps improve the model's ability to fit traffic flow trends, making the constructed prediction model more consistent with actual traffic operation characteristics and improving the accuracy of traffic volume prediction.

[0039] Specifically, the study area was selected as 16 sections of a highway in a certain area, and traffic flow data within a specified time range of the study area was obtained based on big data.

[0040] The data collection and preprocessing steps include the following: collecting traffic volume data and its influencing factors; cleaning and normalizing the data; and dividing the dataset into training, validation, and test sets.

[0041] Traffic flow data is preprocessed, including handling missing and outlier values.

[0042] The dataset was split using the hold-out method, with test_size=0.3, meaning the test set comprised 30% of the entire dataset, while the remaining 70% was used for training.

[0043] Furthermore, in step S2, based on the traffic flow data, after cleaning and normalization, key feature variables are selected through the correlation between features and the target variable. A random forest prediction model is constructed based on the selected features, the model structure parameters are set, and the key parameters of the model are optimized by combining the control variable method and the grid search strategy to achieve traffic flow prediction for each section of the highway, including the following steps B1-B2: B1. Based on the strength of the linear relationship between the features and the target variable, four key feature variables are selected, which are then used as the input for model construction.

[0044] B2. Based on the selected features, construct a traffic flow prediction model using the random forest algorithm.

[0045] Furthermore, in step B1, four key feature variables are selected based on the strength of the linear relationship between the features and the target variable, ultimately obtaining the input for model construction, including the following steps B11-B12: B11. Use the SelectKBest method in Scikit-Learn, combined with f_regression, to select key features based on the strength of the linear relationship between the features and the target variable, and obtain the relevance score of each feature through selector.scores_.

[0046] B12. Determine the most important features based on feature importance scores, and use them as input for model construction.

[0047] In this embodiment of the application, the correlation score in step B11 can be obtained by using the SelectKBest method in Scikit-Learn, combined with f_regression to filter traffic flow prediction-related features, and then using selector.scores_ to calculate the linear relationship score between each feature and the target variable.

[0048] In an alternative implementation, the relevance score can also be used during the feature selection process to filter the top-ranked feature variables based on a preset threshold, which is then used to determine the input range for model construction.

[0049] In another alternative implementation, the correlation score can also be combined with cross-validation to calculate the average and fluctuation range of the feature scores in multiple rounds of training data.

[0050] This invention obtains the correlation score between features and target variables, and selects key feature variables with strong representativeness and low interference as model inputs accordingly. This can effectively reduce redundant features, improve modeling efficiency and prediction accuracy, and provide data basis for model structure optimization.

[0051] Specifically, in step B12, the most important features are determined based on the feature importance scores, and finally four core feature variables are selected: population (X2), highway freight volume (X7), GDP (X1), and motor vehicle ownership (X5) as inputs for subsequent model construction.

[0052] Furthermore, in step B2, a traffic flow prediction model is constructed using the random forest algorithm based on the selected features, including the following steps: A traffic flow prediction model was constructed using the random forest algorithm, and the key parameters of the model were optimized and tuned using the grid search method to determine the optimal parameter combination.

[0053] Traditional methods, based on the algorithmic steps of grey system theory, yield the following time response equation for the grey system theory prediction model: in, For the first-order accumulation generation sequence, the sequence is generated at the th order. Predicted value at time, The values ​​of the original sequence at the initial time step. For time indexing, For the predicted time length, Represents the development coefficient. This represents the gray effect quantity.

[0054] Specifically, a traffic flow prediction model was constructed using the random forest algorithm, and key parameters (such as n_estimators and max_depth) were optimized and tuned using a grid search method to determine the optimal parameter combinations. During the modeling process, the random forest algorithm parameters were set as follows: n_estimators, max_depth, min_samples_split, and min_samples_leaf, with default values ​​of 100, None, 2, and 1, respectively. The impact of each parameter on the model was investigated, and the four parameters were set using the controlled variable method to obtain four parameter combinations. These four parameter combinations were then fine-tuned using a grid search method, and 10-fold cross-validation (CV=10) was employed to obtain two optimal parameter combinations.

[0055] This invention employs a hybrid parameter tuning strategy combining the controlled variable method and grid search. Instead of relying solely on the common grid search, it designs a step-by-step optimization strategy to address the challenge of determining the parameters of the random forest model. This solves the problems of difficult parameter determination, overfitting, or underfitting in traffic prediction using random forest models, ensuring more stable model performance.

[0056] In the embodiments of this application, the prediction accuracy evaluation index in step S3 can be one of three types: MAE, RMSE, and relative error, to evaluate the accuracy of the traffic flow prediction results of the random forest model.

[0057] In an alternative implementation, the prediction accuracy evaluation metrics may also use only MAE and RMSE to analyze the accuracy of the prediction results.

[0058] In another alternative implementation, the prediction accuracy evaluation index can also use only the relative error to measure the proportional deviation of the prediction results.

[0059] This invention uses three types of prediction accuracy evaluation indicators—MAE, RMSE, and relative error—to quantitatively evaluate the traffic flow prediction results of the two types of models from different perspectives, which can comprehensively reflect the prediction deviation of the models.

[0060] Furthermore, in step S3, based on traffic flow prediction, the prediction results are evaluated using prediction accuracy evaluation indicators, including: The predictive performance of the model is evaluated using MAE, RMSE, and relative error metrics.

[0061] Based on traffic flow prediction, three evaluation indicators are used: RMSE, MAE, and relative error. The formulas for these evaluation indicators are as follows: in, The root mean square error, For the sample size, For sample index, For the first The predicted value for each sample, For the first The actual value of each sample The mean absolute error, For the first one sample .

[0062] The characteristic variables are population, highway freight volume, GDP, and motor vehicle ownership, and the target variable is the traffic volume of the first section of a highway in a certain area.

[0063] This invention creatively introduces a traffic flow prediction model, constructing a prediction model based on the random forest algorithm that comprehensively considers the impact of factors such as population, highway freight volume, GDP, and motor vehicle ownership on traffic volume. The proposed method for constructing a random forest-based prediction model effectively improves the accuracy of traffic volume prediction.

[0064] Example 3 is an embodiment of the present invention, which provides a method for predicting highway traffic volume based on a random forest model. To verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.

[0065] The characteristic variables were determined as population, highway freight volume, GDP, and motor vehicle ownership, and the target variable was the traffic volume of the first section of a highway in a certain area. The relevant dataset was preprocessed and transformed into a two-dimensional array. The dataset was divided into training and test sets, and test_size=0.3 was set. A grey theory model and a random forest model were constructed and trained, tested, and optimized. The prediction results of the random forest model and the grey system theory model were compared and verified using three evaluation indicators: RMSE, MAE, and relative error. Based on the prediction performance of the two models, the random forest model was found to be significantly better than the grey system theory model in all error indicators.

[0066] Based on prediction data from the grey theory model and the random forest model from 2012 to 2019, the prediction performance of these two models was compared, and it was found that the random forest model performed better. The steps included: The characteristic variables are population, highway freight volume, GDP, and motor vehicle ownership. The target variable is the traffic volume of the first section of a highway in a certain area. The relevant dataset is preprocessed and transformed into a two-dimensional array.

[0067] The dataset is divided into training and testing sets, and test_size is set to 0.3.

[0068] We construct grey theory models and random forest models, and then train, test, and optimize them.

[0069] The prediction results of the random forest model and the grey system theory model are compared and verified using three evaluation indicators: RMSE, MAE, and relative error.

[0070] Based on the prediction results of the two models, the random forest model is significantly better than the grey system theory model in all error metrics.

[0071] The comparison of prediction results is shown in Table 1.

[0072] Table 1 Comparison of Prediction Performance of the Two Models

[0073] The above description clearly demonstrates the advantages of this invention over traditional grey system theoretical models in terms of RMSE, MAE, and relative error, effectively improving the traffic volume prediction capability and enhancing the credibility of this invention.

[0074] Example 4 is an embodiment of the present invention, which provides a highway traffic volume prediction system based on a random forest model, including a data acquisition module, a prediction module and an evaluation and comparison module; The data acquisition module is used to select highway sections in the study area and obtain traffic flow data within a specified time range in the study area; The prediction module is used to predict traffic flow on various sections of the highway based on traffic flow data, using grey system theory models and random forest models. The evaluation and comparison module is used to evaluate the accuracy of traffic flow predictions using prediction accuracy evaluation indicators.

[0075] This embodiment also provides an electronic device applicable to a highway traffic volume prediction method based on a random forest model, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the highway traffic volume prediction method based on a random forest model as proposed in the above embodiment.

[0076] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements a highway traffic volume prediction method based on a random forest model as proposed in the above embodiment.

[0077] The storage medium proposed in this embodiment and the method for predicting highway traffic volume based on a random forest model proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0078] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0079] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for predicting highway traffic volume based on a random forest model, characterized in that: include, Select highway sections within the study area and obtain traffic flow data for the specified time range within the study area; Based on traffic flow data, after cleaning and normalization, key feature variables are selected by the correlation between features and target variables. A random forest prediction model is constructed based on the selected features, the model structure parameters are set, and the key parameters of the model are optimized by combining the control variable method and grid search strategy to achieve traffic flow prediction for each section of the highway. Based on traffic flow forecasts, the forecast accuracy evaluation index is used to assess the accuracy of the forecast results.

2. The highway traffic volume prediction method based on a random forest model as described in claim 1, characterized in that: The selected study area is a highway section. Traffic flow data for the study area within a specified time range is obtained, including: Collect traffic flow data and influencing factor data; The data is cleaned and normalized. The dataset is divided into training, validation, and test sets.

3. The highway traffic volume prediction method based on a random forest model as described in claim 2, characterized in that: The process involves cleaning and normalizing traffic flow data, then filtering key feature variables based on the correlation between features and the target variable. A random forest prediction model is constructed based on the selected features, model structure parameters are set, and the key parameters are optimized using a control variable method and a grid search strategy to achieve traffic flow prediction for various sections of the highway. Based on the strength of the linear relationship between the features and the target variable, four key feature variables are selected, which are then used as the input for model construction. Based on the selected features, a traffic flow prediction model is constructed using the random forest algorithm.

4. The highway traffic volume prediction method based on a random forest model as described in claim 3, characterized in that: The four key feature variables are selected based on the strength of the linear relationship between the features and the target variable, which ultimately become the input for model construction, including: The SelectKBest method in Scikit-Learn is used in conjunction with f_regression for feature selection. Key features are selected based on the strength of the linear relationship between the features and the target variable, and the relevance score of each feature is obtained through selector.scores_. The most important features are determined based on feature importance scores and used as input for model construction.

5. The highway traffic volume prediction method based on a random forest model as described in claim 4, characterized in that: The most important features are determined based on feature importance scores, and the inputs for model construction include four core feature variables: population, highway freight volume, GDP, and motor vehicle ownership. The process of constructing a traffic flow prediction model based on selected features using a random forest algorithm includes, A traffic flow prediction model was constructed using the random forest algorithm, and the key parameters of the model were optimized and tuned using the grid search method to determine the optimal parameter combination.

6. The highway traffic volume prediction method based on a random forest model as described in claim 5, characterized in that: The process of evaluating the accuracy of traffic flow predictions using prediction accuracy evaluation indicators includes, among other things, the following: The predictive performance of the model is evaluated using MAE, RMSE, and relative error metrics.

7. The highway traffic volume prediction method based on a random forest model as described in claim 6, characterized in that: The method involves constructing a traffic flow prediction model using the random forest algorithm and optimizing key parameters of the model using a grid search method to determine the optimal parameter combination. Set the parameters for the random forest algorithm during the modeling process; To study the impact of each parameter on the model, the four parameters were set using the controlled variable method, and the impact of each parameter on the model was obtained, resulting in four parameter combinations. The four parameter combinations were optimized using a grid search method and 10-fold cross-validation was used to obtain two optimal parameter combinations.

8. A highway traffic volume prediction system based on a random forest model, employing the highway traffic volume prediction method based on a random forest model as described in any one of claims 1 to 7, characterized in that, include: Data acquisition module, prediction module, and evaluation and comparison module; The data acquisition module is used to select a highway section in the study area and obtain traffic flow data within a specified time range in the study area; The prediction module is used to clean and normalize traffic flow data, filter key feature variables by the correlation between features and target variables, construct a random forest prediction model based on the selected features, set model structure parameters, and optimize the key parameters of the model by combining the control variable method and grid search strategy to achieve traffic flow prediction for each section of the highway. The evaluation and comparison module is used to evaluate the accuracy of the prediction results based on traffic flow prediction using prediction accuracy evaluation indicators.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the highway traffic volume prediction method based on the random forest model according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the highway traffic volume prediction method based on the random forest model according to any one of claims 1 to 7.