*2.4. Exploration of Optimum Response Time in Days*

In order to study the optimum response time of the most significant correlations between cumulative environmental factors and fresh weight growth, a naive Bayesian network [31–33] was used to establish the relationship model. There were *n* − *k* elements in the dataset, including cumulative environmental factors, instantaneous fresh weight, and fresh weight increments of the previous *k* days, and the dataset was divided into a training set and a test set. The training set was introduced into the naive Bayesian network for model training, and the test set was used for model testing.

The determination coefficient of the model was calculated by referring to Formula (12) using predicted values and measured values, and was used to examine the degree of correlation between predicted values and measured values of the samples in the dataset. The normal value range is from 0 to 1, and the closer it is to 1, the better the model fits the data. The calculation formula is as follows:

$$R^2 = 1 - \frac{\sum\_{i=1}^{n} \left( y\_{\text{-}test} - y\_{\text{-}pre} \right)^2}{\sum\_{i=1}^{n} \left( y\_{\text{-}test} - y\_{\text{-}mean} \right)^2} \tag{12}$$

where *y\_testi* is the measured value of the i-th sample in the dataset (g), *y\_prei* is the predicted value of the i-th sample in the dataset (g), and *y\_mean* is the average of the measured values of all samples in the dataset (g).

The coefficient of determination was used as the evaluation index of the model. The larger the coefficient of determination, the more significant the relationship between cumulative environmental factors and fresh weight growth.

The solution process with the most significant response between cumulative environmental factors and fresh weight growth in the previous *k* days is shown in Figure 3. The figures on the *y* axis represent the environmental parameters (temperature, humidity, photosynthetically active radiation, and carbon dioxide concentration) or the instantaneous fresh weight of lettuce at a certain time. Firstly, instantaneous fresh weight on day 1, cumulative environmental factors (cumulative radiant heat product, crop evapotranspiration, and average carbon dioxide concentration), and fresh weight increment from day 1 to day *k* + 1 were taken as the first element group in constructing the dataset. The instantaneous fresh weight on day 2, cumulative environmental factors, and fresh weight increment from day 2 to day *k* + 2 were used as the second element group in constructing the dataset. Correspondingly, instantaneous fresh weight on day *n–k*, cumulative environmental factors, and fresh weight increment from day *n* − *k* to day *n* were taken as the last element group in constructing the dataset, which had a total of *n–k* element groups. The dataset was then divided into a training set and a test set, and the training set was substituted into the naive Bayesian network for model training. Finally, the test set was substituted into the above model and the determination coefficient was calculated, which was used as the evaluation index for the significance of the response between cumulative environmental factors and fresh weight growth in the previous *k* days.

**Figure 3.** Schematic diagram of the solution process for the most significant response between cumulative environmental factors and fresh weight growth in the previous *k* days.
