# Building Tree Allometry Relationships Based on TLS Point Clouds and Machine Learning Regression
## 2 Materials and Methods
### Allometric Models  
Six allometric models were tested to fit the DBH estimation from H and H + CD predictor variables; one based on traditional linear regression and the remaining five focused on supervised machine learning algorithms. An individual-based modelling approach was used by considering each individual tree measurement as an instance of the complex relationships modelled  
The linear regression model used in this study was based on the widely known potential form (e.g., [14; 18]). After taking logarithms to linearize the potential expression, we obtained the following equations:  
\[\mathrm{DBH}=\mathrm{e}^{(\alpha+\beta\ln{(H)})}\mathrm{e}^{\varepsilon}= \mathrm{e}^{(\alpha+\beta\ln{(H)})}\mathrm{e}^{\frac{\alpha^{2}}{2}}, \tag{1}\]  
\[\mathrm{DBH}=\mathrm{e}^{(\alpha+\beta\ln{(H.CD)})}\mathrm{e}^{\varepsilon}= \mathrm{e}^{(\alpha+\beta\ln{(H.CD)})}\mathrm{e}^{\frac{\alpha^{2}}{2}}, \tag{2}\]  
where DBH is given in centimeters, and H and CD in meters. \(\alpha\) and \(\beta\) are model coefficients, and \(\varepsilon\) is an error term. If it is considered that the error term is normally distributed with zero mean and standard deviation \(\sigma\), the mean of \(\mathrm{e}^{\varepsilon}\) could be approximated by \(\mathrm{e}^{\frac{\alpha^{2}}{2}}\)[17]. This additional term would function as a correction factor applied to back transform the predicted values and remove bias from the logarithmically transformed data. Figure 2: Configuration of scan positions within a reference plot and TLS point cloud. (**a**) Sketch of circular reference plots depicting the approximate location of the four TLS scans. (**b**) Automatically segmented teak trees from TLS point cloud depicting ground (brown) and vegetation (green) classified points. Regarding supervised machine learning methods, this study has focused on testing tree-based regression learners such as individual tree-based models (Decision Tree Regression, DTR) and some derive ensemble algorithms grouped in bagging techniques (Random Forest Regression, RFR) and boosting techniques (AdaBoost Regression, AdaBoost; Gradient Boosting Regression, GBoost; and Categorical Boosting Regression, CatBoost). The optimal combination of hyperparameters for each machine learning model was computed by applying a grid search with cross-validation method [25]. The validation of the tested allometric models was based on the widely accepted true validation method. This method states that the data used to train the model can never be used for validation. In this sense, the testing set for validation consisted of 20% of the 2272 available trees, leaving the remaining 80% as a set for training and computing the regression model. This procedure was repeated 100 times, splitting the original data between the training and the testing sets by using random sampling. It allowed studying the stability of the tested regression models against changes in the training samples. Some error indicators related to the systematic and random error of the DBH values predicted by the regression models were calculated according to the following expressions:  
\[\text{Bias}\;(\%)=\frac{100}{\text{N}}\sum_{\text{i=1}}^{\text{N}}\left( \frac{\text{DBHp}_{\text{i}}-\text{DBHo}_{\text{i}}}{\text{DBHo}_{\text{i}}} \right), \tag{3}\]  
\[\text{RMSE}\;(\text{cm})=\sqrt{\frac{\sum_{\text{i=1}}^{\text{N}}(\text{DBHp }_{\text{i}}-\text{DBHo}_{\text{i}})^{2}}{\text{N}}}, \tag{4}\]  
\[\text{RMSE}_{\text{relative}}\;(\%)=100\frac{\text{RMSE}}{\text{DBHo}}\;, \tag{5}\]  
where DBHp and DBHo corresponds to DBH values predicted and observed, respectively. N and \(\overline{\text{DBHo}}\) are the number of teak trees in the testing dataset and the mean value of DBH observed values for the teak trees, respectively. Note that the Bias indicator constitutes a measure of the systematic error or bias of the model, while RMSE (root-mean-square error) is a quantitative indicator of its random error.