An automobile wind resistance prediction method based on an XGBoost algorithm

By employing the XGBoost algorithm and feature engineering, combined with multi-stage hyperparameter tuning, the problem of high computational resource consumption and time cost in traditional CFD methods for wind resistance prediction is solved. This enables fast and efficient wind resistance prediction, improves prediction accuracy and computational efficiency, and provides a rapid iteration tool for automotive design.

CN122133428APending Publication Date: 2026-06-02SOUTH CHINA UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTH CHINA UNIV OF TECH
Filing Date
2026-01-06
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Traditional CFD methods consume huge computational resources and are time-consuming in predicting the drag coefficient of automobiles, which cannot meet the timeliness requirements of frequent design scheme verification. Furthermore, CNN models have high computational resource requirements and are not conducive to designers' understanding of the impact of key design parameters.

Method used

A wind resistance prediction model is constructed by combining the XGBoost algorithm with feature selection and multi-stage hyperparameter tuning. Training data is generated through Latin hypercube sampling, and multinomial, interactive, statistical and ratio features are introduced. The model parameters are optimized by the early stopping mechanism to achieve fast and efficient wind resistance prediction.

Benefits of technology

It significantly improves the accuracy and efficiency of wind resistance prediction, increases computational efficiency by orders of magnitude, and reduces the relative prediction error to less than 3%, providing designers with a rapid iteration tool, shortening the R&D cycle and optimizing data collection costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133428A_ABST
    Figure CN122133428A_ABST
Patent Text Reader

Abstract

This invention discloses a method for predicting automotive drag coefficients based on the XGBoost algorithm, comprising the following steps: collecting the design range of various components of the aerodynamic exterior trim of the project vehicle, and generating a sample space using Latin hypercube sampling; calculating the drag coefficient of each corresponding sample data; adding feature engineering, dividing the dataset into training, validation, and test sets, and performing min-max data normalization; obtaining the optimal XGBoost model through multi-stage hyperparameter tuning combined with early stopping method; and outputting feature importance scores. This invention, by constructing an XGBoost-based drag prediction model, achieves rapid and efficient prediction of automotive drag coefficients at the component level, significantly improving computational efficiency and reducing data acquisition costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine learning methods and automotive aerodynamics, specifically to a method for predicting automotive drag based on the XGBoost algorithm. Background Technology

[0002] Automotive aerodynamic performance is a core element of vehicle design, with the drag coefficient (Cd value) serving as a key evaluation indicator, directly impacting fuel economy, driving stability, and emissions. During the automotive design process, aerodynamic exterior components, due to their significant impact on overall aerodynamic performance and relatively low modification costs, become frequently adjusted targets in design iterations. Designers need to frequently evaluate the impact of exterior component changes on the drag coefficient to optimize overall vehicle performance. Traditional drag coefficient prediction primarily relies on computational fluid dynamics (CFD) simulation technology. While this method simulates fluid motion by constructing physical models and provides high-precision results, it suffers from significant bottlenecks: enormous computational resource consumption (a single simulation requires processing tens to hundreds of millions of mesh points for iterative solutions); high time costs (a single simulation can take hours or even days); and low iteration efficiency, failing to meet the time-sensitive requirements of frequent solution verification. In the current context of accelerated product iteration and intensified competition in the automotive industry, the high time cost of traditional CFD methods has become a key bottleneck restricting design efficiency, necessitating the development of efficient alternatives to support rapid design decisions.

[0003] XGBoost (eXtreme Gradient Boosting) is a high-efficiency ensemble learning algorithm based on the gradient boosting framework. Its core idea is to iteratively generate multiple weak learners (decision trees) to gradually fit the residuals of the previous prediction, thereby continuously improving the model's generalization ability. The core of this algorithm lies in performing a second-order Taylor expansion of the loss function, while simultaneously utilizing first-order gradients and second-order Hessian matrix information to more accurately approximate the objective function, significantly accelerating convergence while improving prediction accuracy. XGBoost introduces regularization terms into the objective function (including L1 penalties for the number of leaf nodes and L2 constraints for weights) to effectively suppress overfitting. In the node splitting stage, a greedy algorithm is used, whose gain calculation comprehensively considers the gradient statistics and structural complexity penalties of the split subtrees, ensuring that the splitting strategy balances purity improvement and model simplicity. In engineering implementation, XGBoost supports parallel computation through feature pre-sorting and block structure design, automatically handles missing values ​​through a built-in sparsity-aware mechanism, and supports out-of-kernel computation to improve the efficiency of large-scale data processing. During the final prediction, each sample falls into a leaf node in each tree and obtains a corresponding score. The scores of all trees are added together to obtain the final prediction result, which demonstrates excellent prediction performance and engineering practicality in various structured data tasks.

[0004] An existing method that integrates sparse octrees and convolutional neural networks (CNN) (Prediction of Vehicle Drag Coefficient by Integrating Sparse Octree Trees and Convolutional Neural Networks_Wang Gang) first converts the 3D geometric model of the vehicle into a sparse octree structure to handle complex shapes, and then uses CNN for feature learning and prediction. While this method achieves high prediction accuracy (minimum relative error 1.453%), its performance heavily relies on accurate 3D modeling and discretization of the vehicle geometry, resulting in a complex computational process and high computational resource requirements. Furthermore, the CNN model does not focus on specific exterior components, hindering designers' understanding of the impact of key design parameters. Summary of the Invention

[0005] To address the aforementioned issues, this invention provides a vehicle drag prediction method based on the XGBoost algorithm. The aim is to achieve fast and efficient drag prediction using the XGBoost algorithm model, while reducing data requirements and computational costs. Specifically, through feature selection and the XGBoost model, the prediction process is simplified and prediction efficiency is improved, reducing data requirements and meeting accuracy requirements with less data. Data acquisition costs are optimized, allowing for a focused analysis of the impact of component size changes on overall vehicle drag. In particular, it allows for the addition of combined features to enhance prediction accuracy and practicality. This provides a rapidly iterative intelligent tool for automotive aerodynamic design and improvement, thereby accelerating the R&D cycle and improving R&D efficiency. This addresses the problems of parameter optimization difficulties, high computational resource consumption, and large data requirements arising from complex model predictions in drag coefficient prediction.

[0006] The above-mentioned objective of the present invention is achieved by at least one of the following technical solutions.

[0007] A method for predicting vehicle drag based on the XGBoost algorithm includes the following steps: The corresponding feature parameters are input into the trained wind resistance prediction model, and the predicted wind resistance coefficient is output; the wind resistance prediction model is obtained through multi-stage hyperparameter tuning and training.

[0008] Furthermore, the training of the wind resistance prediction model includes the following steps: Step S1: Collect the design range of each component of the project vehicle's aerodynamic exterior trim and generate a sample space using Latin hypercube sampling; Step S2: Add feature engineering, divide the training set, validation set, and test set, and perform min-max data normalization; Step S3: The initial XGBoost model is optimized through multi-stage hyperparameter tuning, and the optimal parameters of the XGBoost model are obtained by training with the early stopping method as the wind resistance prediction model.

[0009] Further, step S1 specifically includes: standardizing the feature data of each aerodynamic exterior component to form a feature matrix; generating uniformly discrete sampling points in the feature space using the Latin hypercube sampling method and forming sampling combinations; using computational fluid dynamics simulation software to calculate the drag coefficient under all sampling point combinations respectively, and recording each set of feature data and the corresponding drag coefficient.

[0010] Furthermore, step S2 specifically includes: introducing polynomial features, interaction features, statistical features, and ratio features.

[0011] Furthermore, polynomial features are introduced, including: tail fin angle of attack squared, tail fin height squared, front air dam height squared, and rear air dam height squared. Interactive features include: tail fin angle of attack × tail fin height, rear air dam height × front air dam height, and tail fin angle of attack × rear air dam height. Tail fin angle of attack × front air dam height, tail fin height × front air dam height, tail fin height × rear air dam height; Statistical characteristics include: maximum value, minimum value, interval, variance, standard deviation, and mean. The ratio characteristics include: the ratio of front and rear air dam heights and the ratio of tail fin angle of attack heights.

[0012] Furthermore, the feature data normalization uses the min-max method, as shown in the following formula:

[0013] in These are the normalized eigenvalue data, where The maximum value of the sample data. This represents the minimum value of the sample data.

[0014] Furthermore, the multi-stage hyperparameter tuning in step S3 includes a three-stage hyperparameter optimization method: Phase 1: Use a grid search function to coarsely tune the main structural parameters to obtain the initial XGBoost model; Phase Two: Fine-tuning the regularization parameters to optimize the model; The third stage: combine the best parameters obtained in the first two stages, use an early stopping mechanism to lock the best iteration round, and obtain the final model.

[0015] Furthermore, the objective function of the XGBoost model is:

[0016] in, Let be the objective function. It is the first tree The regularization term, It is the first Tree samples The predicted value, and Let these be the first and second gradients of the loss function with respect to the previous round of predictions. This represents the total number of trees.

[0017] A computer device according to the present invention includes a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, which, when executed by the processor, causes the processor to implement the method described herein.

[0018] The present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor implements the method described herein.

[0019] Compared with the prior art, the present invention has the following advantages and beneficial effects: 1. This invention applies the XGBoost algorithm to the field of automotive drag coefficient prediction, achieving an effective combination of data-driven and physical simulation. Through an experimental design using Latin hypercube sampling, training data is generated using CFD simulation, and then a prediction model is constructed using XGBoost, establishing a complete technical route from parameter space → CFD simulation → machine learning model.

[0020] 2. A three-stage hyperparameter optimization method is proposed: Stage 1: coarse tuning of key structural parameters (n_estimators, max_depth, learning_rate, etc.); Stage 2: fine tuning of regularization parameters (reg_alpha, reg_lambda, gamma, etc.); Stage 3: final training with an early stopping mechanism to lock in the optimal iteration rounds. This progressive optimization strategy effectively balances search efficiency and model performance, effectively solving the problem of difficult parameter optimization for complex models.

[0021] 3. Significantly improved prediction accuracy. Experimental results show that the XGBoost model performs excellently in the drag coefficient prediction task: the coefficient of determination R² reaches 0.7080, which is significantly better than the comparison algorithms (RF: 0.5360, DT: 0.4645, SVM: 0.4207, BPNN: 0.3667). The maximum relative prediction error is 2.9%, which fully meets the engineering design requirements. It can maintain high prediction accuracy even with a small amount of data, demonstrating the algorithm's powerful learning ability.

[0022] 4. Revolutionary Improvement in Computational Efficiency. Compared to traditional CFD methods, this invention achieves an order-of-magnitude improvement in computational efficiency: a single CFD simulation takes hours to days; XGBoost prediction is completed almost in real time after training; training time is only 22.0 ms, far lower than comparable algorithms such as SVM (88.2 ms). This advantage enables designers to evaluate a large number of design options in a short time, greatly accelerating the product iteration cycle.

[0023] 5. By introducing advanced feature engineering methods such as polynomial features, interaction features, statistical features, and ratio features, the complex nonlinear relationships and parameter coupling effects in aerodynamic systems are effectively captured. Feature importance analysis shows that the "interaction term between tail fin angle of attack and tail fin height" is the most predictive feature, providing clear engineering guidance for component-level aerodynamic optimization. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of a vehicle drag prediction method based on the XGBoost algorithm in an embodiment.

[0025] Figure 2 This is a comparison chart of the predicted and actual drag coefficient values ​​in the example.

[0026] Figure 3 This is a performance comparison chart of the model in the example.

[0027] Figure 4 This is a comparison chart of feature importance scores for the embodiments. Detailed Implementation

[0028] The technical solution provided by the present invention will be described in detail below with reference to specific embodiments. The flowchart of the present invention is as follows: Figure 1 As shown, it should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.

[0029] The data in this embodiment comes from the design data of a project of a certain automobile group. Taking the impact of the rear wing and front and rear air dams on wind resistance in this project as an example, the design scope of the parts is provided by the product engineers, which has practical engineering significance and can effectively ensure the data prediction needs of the design department.

[0030] like Figure 1 As shown in this embodiment, a vehicle drag prediction method based on the XGBoost algorithm includes the following steps: Step 1: Collect the design scope of each component of the project vehicle's aerodynamic exterior trim and use Latin hypercube sampling to produce a sample space.

[0031] In one embodiment, the tail fin angle of attack, tail fin height, front air barrier height, and rear air barrier height are selected as basic features. First, Latin hypercube sampling is implemented using the `pyDOE2.lns` function in Python to obtain the tail fin and air barrier feature matrices, which are then used as input parameters. The surface mesh file is imported into the pre-processing software ANSA, and the Morph function in ANSA is used to transform the mesh feature dimensions accordingly. The processed mesh model is then imported into the fluid dynamics calculation software Star-CCM+ for calculation. The CFD results yield the corresponding drag coefficient Cd, with a total of 100 sets of data calculated.

[0032] Step 2: Add feature engineering, divide the training set, validation set, and test set, and perform preprocessing such as min-max data normalization.

[0033] Feature engineering is used to add interactive features to wind resistance prediction models to improve model performance. It adds multinomial features to capture nonlinear effects in aerodynamics; interactive features to reflect the coupling relationship between parameters in aerodynamics; statistical features to characterize the position and distribution characteristics of each sample in the overall feature space; and ratio features to construct dimensionless parameters and capture the influence of relative proportions on aerodynamic performance.

[0034] Feature engineering in this embodiment includes: Introducing polynomial features: tail fin angle of attack squared, tail fin height squared, front air dam height squared, and rear air dam height squared.

[0035] Interactive features: Tail fin angle of attack × tail fin height, rear air dam height × front air dam height, tail fin angle of attack × rear air dam height Tail fin angle of attack × front air dam height, tail fin height × front air dam height, tail fin height × rear air dam height.

[0036] Statistical characteristics: maximum value, minimum value, interval, variance, standard deviation, and mean.

[0037] Ratio characteristics: front and rear air dam height ratio, tail fin angle of attack height ratio.

[0038] Data preprocessing: The data is randomly split into 70 training sets, 15 validation sets, and 15 prediction sets using the train_test_split function. Shuffle=True shuffles the data before splitting to avoid potential influence from ordering. StandardScaler is used to standardize the features, scaling the data to a distribution with a mean of 0 and a variance of 1. This speeds up model convergence and improves prediction performance.

[0039] Step 3: Establish a wind resistance prediction model. Through multi-stage hyperparameter tuning, and combined with early stopping method training, the optimal parameters of the XGboost model are obtained as the wind resistance prediction pre-model.

[0040] XGBoost is an efficient and widely used machine learning method. Its core idea is to combine multiple weak learners into a single strong learner using an additive model. Specifically, XGBoost employs a forward stagewise algorithm, iteratively adding new base learners to optimize the objective function. In each iteration, the newly added base learners... Dedicated to revising the previous prediction model The objective function of XGBoost is to gradually improve the overall prediction performance of the model by analyzing the prediction residuals. In the During round iteration, the loss function and regularization term It consists of two parts, and its mathematical expression is as follows:

[0041] in: It measures the true value Compared with the predicted value Differentiable convex loss function for the difference between them (mean square error MSE for this example problem); It is the first Tree samples The predicted value, The total number of trees; It is the first The regularization term for the tree is used to control model complexity; directly optimizing this objective function is difficult. XGBoost uses a second-order Taylor expansion to approximate it, letting:

[0042]

[0043] Represent the loss function respectively Regarding the previous round of forecasts first gradient and second gradient . The loss function is represented by [symbol]. For the previous round of forecasts The partial derivatives of .

[0044] After removing the constant term, the simplified objective function is obtained as follows:

[0045] Regularization term It is usually defined as:

[0046] in This represents the number of leaf nodes in the current tree. It is a leaf node Weight (score) and It is a hyperparameter that controls the strength of regularization. This is achieved by defining leaf nodes. sample set on and the sum of the first-order gradients at that node. Sum of second-order gradients ,in It is a function that takes samples Mapped to the index of its leaf node The objective function can be reparameterized for each leaf node, and the optimal weight for each leaf node can be obtained. for:

[0047] Accordingly, after substituting the optimal weights, the optimal (minimum) objective function value that this tree structure can achieve is... It can be represented as:

[0048] This value is often used to evaluate tree structure. A quality metric, the smaller the value (i.e., the more negative the value, the smaller the original objective function value), the better the tree structure. In other words, the ultimate goal of training the model is to find the minimum... .

[0049] During tree growth, XGBoost needs to evaluate all possible splitting schemes to find the optimal split point. For a candidate split, it divides the samples of the current node into the left subtree. and right subtree Evaluate the gain brought about by this split ( The formula for ) is:

[0050] in, and These are the sums of the first and second gradient statistics on the left and right child nodes, respectively. The first and second terms of the gain formula measure the "purity" or "fraction" of the left and right child nodes after the split, while the third term is the "fraction" of the parent node before the split. The larger the gain value, the greater the contribution of the split to reducing the objective function. It is a regularization term, which is equivalent to penalizing the addition of new leaf nodes, preventing the model from becoming too complex and helping to control overfitting.

[0051] In one embodiment, 85 sets of data are used for model training. For the initial XGBoost model in the initial training stage, since the drag coefficient is a continuous value, this embodiment uses the mean squared error (MSE) as the loss function, sets the regression mode to squared error objective='reg:squarederror', and sets the random number seed to 42 random_state=42.

[0052] The training process includes the following stages: The first stage involves coarse tuning of five main parameters: n_estimators, max_depth, learning_rate, subsample, and colsample_bytree. The param_grid function is used to weave a parameter grid, which consists of... There are several combinations of parameters, and the GridSearchCV function will iterate through all these combinations. For each combination, CV=5 (5-fold cross-validation) is set to evaluate performance on the training set. The set of parameters with the best average performance on cross-validation is selected: {'n_estimators': 200, 'max_depth': 5, 'learning_rate':0.05, 'subsample': 0.8, 'colsample_bytree': 0.8}. Here, n_estimators is the number of decision trees, and learning_rate is the learning rate. subsample is the subsample, colsample_bytree is the feature sampling rate, and GridSearchCV is grid search + cross-validation.

[0053] The second stage: Using the optimal parameters found in the first stage as the base parameters for this stage of the model, the regularization parameters are adjusted: reg_alpha, reg_lambda, gamma, and min_child_weight. The parameter grid is also woven using the param_grid function, forming a total of [number missing]. We used 5-fold cross-validation to find the optimal combination of regularization parameters. The optimal regularization parameters were found to be {'reg_alpha': 0.1, 'reg_lambda': 1, 'gamma':0.1, 'min_child_weight': 3}, where reg_alpha is the L1 regularization term and reg_lambda is the L2 regularization term. gamma is the minimum loss descent for splitting, and min_child_weight is the minimum sum of weights for child nodes.

[0054] Phase 3: Final Training and Early Stopping (Locking the Optimal Iteration Rounds) Objective: To merge the best parameters from the first two phases and use the validation set to perform "early stopping" during training to find the optimal iteration rounds and obtain the final model.

[0055] Parameter merging: The optimal parameters from the first and second stages are merged into a final parameter dictionary `final_params`. Early stopping is used for training, with `early_stopping_rounds=50`, meaning that training stops if the validation set performance does not improve for 50 consecutive rounds. The significance of early stopping is to dynamically determine `n_estimators`: even if `n_estimators: 200` is set in the first stage, the model may reach its optimal state on the validation set by round 150, and subsequent training will only lead to overfitting to the training set. Early stopping automatically finds this optimal point. Setting `n_jobs=-1` indicates that all available CPU cores are used for parallel computation to accelerate the grid search process. Local experimental platform: Intel Core i5 processor. The system has a CPU speed of 14600KF and 32.0GB of memory; the operating system is Windows 11 (64-bit), and the programming language is Python 3.7. The final XGBoost wind resistance prediction model is obtained through the third stage. Here, `early_stopping_rounds` represents the number of early stopping rounds, `n_estimators` represents the number of decision trees, and `n_jobs` represents the number of parallel processes.

[0056] The final model was used to predict 15 sets of data in the prediction set. The actual values ​​and predicted values ​​were compared as follows: Figure 2 As shown, the XGBoost model has a maximum relative error of 3.0% for the prediction set, which meets the engineering design requirements.

[0057] In addition, commonly used AI algorithms such as Random Forest (RF), Decision Tree (DT), Support Vector Machine (SVM), and Backward Neural Network (BPNN) were compared. The mean absolute error (MAE), mean squared error (MSE), root mean square error (RMSE), mean relative error (MRE), and coefficient of determination (R2) were used to comprehensively compare the model performance in terms of training time, as shown in Table 1.

[0058] Table 1 Comparison of Overall Model Performance

[0059] To more intuitively illustrate the advantages of the XGBoost model, see Figure 3 The radar chart of model performance shows that the XGBoost model has a determination coefficient (R²) of 0.708 even with a small amount of data, and its overall performance outperforms other AI algorithms. The Python joblib module saves the trained XGBoost model. In the actual prediction phase, simply call the pre-stored model function and input the corresponding feature parameters to directly output the predicted drag coefficient.

[0060] Use the `model.feature_importances_` function to output feature importance, such as... Figure 4 As shown, the interaction term between the tail fin angle of attack and tail fin height (characteristic importance 0.1833) was identified as the most predictive characteristic variable, indicating that the coupling effect between parameters in the aerodynamic system plays a dominant role in the drag formation mechanism. This characteristic importance spectrum provides a clear parameter sensitivity ranking for subsequent aerodynamic optimization, indicating that the tail fin system should be the priority optimization direction in engineering design.

[0061] The technical solutions covered by this invention are far more than those disclosed in the specific embodiments of the specification, and also include all feasible technical solutions constructed based on any combination of the foregoing technical features. It should be particularly noted that, for those skilled in the art, without departing from the core principles of this invention, it is entirely possible to make several adaptive adjustments, optimizations, or expansions to the specific implementation methods. These reasonable evolutions and improvements based on the substantive content of this invention should all fall within the protection scope of this invention.

Claims

1. A method for predicting vehicle drag based on the XGBoost algorithm, characterized in that, Includes the following steps: The corresponding feature parameters are input into the trained wind resistance prediction model, and the predicted wind resistance coefficient is output; the wind resistance prediction model is obtained through multi-stage hyperparameter tuning and training.

2. The method for predicting vehicle drag based on the XGBoost algorithm according to claim 1, characterized in that, Training the wind resistance prediction model includes the following steps: Step S1: Collect the design range of each component of the project vehicle's aerodynamic exterior trim and generate a sample space using Latin hypercube sampling; Step S2: Add feature engineering, divide the training set, validation set and test set, and perform min-max data normalization; Step S3: The initial XGBoost model is optimized through multi-stage hyperparameter tuning, and the optimal parameters of the XGBoost model are obtained by training with the early stopping method as the wind resistance prediction model.

3. The method for predicting vehicle drag based on the XGBoost algorithm according to claim 2, characterized in that, Step S1 specifically includes: standardizing the feature data of each aerodynamic exterior component to form a feature matrix; generating uniformly discrete sampling points in the feature space using the Latin hypercube sampling method and forming sampling combinations; using computational fluid dynamics simulation software to calculate the drag coefficient under all sampling point combinations and record each set of feature data and the corresponding drag coefficient.

4. The method for predicting vehicle drag based on the XGBoost algorithm according to claim 2, characterized in that, Step S2 specifically includes: introducing polynomial features, interaction features, statistical features, and ratio features.

5. The method for predicting vehicle drag based on the XGBoost algorithm according to claim 4, characterized in that, The polynomial features introduced include: tail fin angle of attack squared, tail fin height squared, front air dam height squared, and rear air dam height squared. Interactive features include: tail fin angle of attack × tail fin height, rear air dam height × front air dam height, and tail fin angle of attack × rear air dam height. Tail fin angle of attack × front air dam height, tail fin height × front air dam height, tail fin height × rear air dam height; Statistical characteristics include: maximum value, minimum value, interval, variance, standard deviation, and mean. The ratio characteristics include: the ratio of front and rear air dam heights and the ratio of tail fin angle of attack heights.

6. The method for predicting vehicle drag based on the XGBoost algorithm according to claim 2, characterized in that, Feature data normalization uses the min-max method, as shown in the following formula: in These are the normalized eigenvalue data, where The maximum value of the sample data. This represents the minimum value of the sample data.

7. The method for predicting vehicle drag based on the XGBoost algorithm according to claim 2, characterized in that, Step S3, multi-stage hyperparameter tuning, includes a three-stage hyperparameter optimization method: Phase 1: Use a grid search function to coarsely tune the main structural parameters to obtain the initial XGBoost model; Phase Two: Fine-tuning the regularization parameters to optimize the model; The third stage: combine the best parameters obtained in the first two stages, use an early stopping mechanism to lock the best iteration round, and obtain the final model.

8. The method for predicting vehicle drag based on the XGBoost algorithm according to claim 2, characterized in that, The objective function of the XGBoost model is: in, Let be the objective function. It is the first tree The regularization term, It is the first Tree samples The predicted value, and Let these be the first and second gradients of the loss function with respect to the previous round of predictions. This represents the total number of trees.

9. A computer device comprising a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, characterized in that: When the computer program is executed by the processor, it causes the processor to implement the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor implements the method as described in any one of claims 1 to 8.