# Interactive 3D Vase Design Based on Gradient Boosting Decision Trees
## 2 Algorithm and Principle
### LightGBM Algorithm  
LightGBM [29] (Light Gradient Boosting Machine) is a framework based on the GBDT developed by Microsoft. It supports efficient parallel training and has advantages such as faster training speed, lower memory consumption, better accuracy, and support for distributed processing of massive data. In the GBDT algorithm, two different splitting strategies are used: level-wise splitting strategy and leaf-wise splitting strategy. The traditional GBDT adopts a deep splitting strategy which splits all nodes in each layer, which increases the computational complexity of the algorithm and leads to a decrease in efficiency. In contrast, LightGBM uses a leaf-splitting strategy, first calculating the splitting gain of features and then selecting the feature with the highest gain as the splitting node, which improves the utilization of sample information, reduces the computational burden of useless nodes, and improves the efficiency of training models.  
The LightGBM algorithm uses a histogram algorithm to save time and memory. The basic idea is to discretize continuous floating-point eigenvalues into k integers and construct a histogram with a width of k. When traversing data, it accumulates statistics in the histogram based on the discretized values. After completing a data traversal, the histogram accumulates the required statistics and then searches for the optimal segmentation point based on the discrete values of the histogram. Therefore, this algorithm outperforms traditional GBDT algorithms regarding training speed and space utilization. In addition, as the decision tree is a weak classifier, the histogram algorithm has a regularization effect and can effectively prevent overfitting.  
LightGBM uses GOSS (Gradient-based One-Side Sampling) technology to improve training efficiency by utilizing gradient information. GOSS prioritizes retaining samples with larger gradients as these samples are crucial for model updates. Meanwhile, a portion of the samples with smaller gradients is randomly sampled to ensure representativeness and reduce computational complexity. To maintain the balance of data distribution, GOSS weights and adjusts these samples with smaller gradients to compensate for the decrease in quantity. LightGBM also adopts Exclusive Feature Bundling (EFB) technology, which effectively reduces the number of features in model training by identifying and merging exclusive features, thereby improving training efficiency and memory utilization. This technology is particularly suitable for high-dimensional and sparse datasets, making LightGBM more efficient in processing large-scale data. The pseudocode for LightGBM is shown in Algorithm 1.  
```
1:Input: train_data, test_data, hyperparameters
2:Output: predictions
3:lgb_model = lgb_LGBRegressor(learning_rate = hyperparameters['learning_rate'],  max_depth = hyperparameters['max_depth'],  subsample = hyperparameters['subsample'],  colsample_bylevel = hyperparameters['colsample_bylevel],  n_estimators = hyperparameters['n_estimators'],  random_seed = 42)
4:lgb_model.fit(train_data['X'], train_data['y'], eval_set = (test_data['X'], test_data['y']))
5:predictions = lgb_model.predict(test_data['X'])
6:return predictions
```  
**Algorithm 1**LightGBM Algorithm