Assessment of Urban Agglomeration Ecological Sustainability and Identification of Influencing Factors: Based on the 3DEF Model and the Random Forest

The evaluation of ecological sustainability is significant for high-quality urban development and scientific management and regulation. Taking the Chengdu urban agglomeration (CUA) as the research object, this paper combined the three-dimensional ecological footprint model (3DEF) and random forest to evaluate the ecological sustainability of the study area and identify the influencing factors. The study results indicate that: (1) From 2000 to 2019, the ecological sustainability of Chengdu urban agglomeration was divided into four types, and the overall ecological sustainability of this region showed a downward trend. The areas with higher ecological sustainability were mainly distributed in the northern part of the urban agglomeration (Mianyang City) and the southern part (Leshan City and Ya’an City), while the cities in the central region (Chengdu City, Meishan City, and Ziyang City) had lower ecological sustainability. (2) The main factors affecting the ecological sustainability of urban agglomerations are industrial wastewater discharge, industrial smoke (powder) dust discharge, and green coverage of built-up areas, followed by urbanization and population size. Through this study, we have two meaningful findings: (a) Our research method in this paper provides a new way to study the factors affecting the ecological sustainability of urban agglomerations. (b) The results of the identification of influencing factors might be the reference for urban environmental infrastructure construction and urban planning.


Introduction
Since the reform and opening up, China's economy has developed rapidly. However, many ecological and environmental problems have emerged. China's environmental protection and sustainable development are full of challenges [1]. Among the Sustainable Development Goals (SDGs), the ecological Sustainable Development Goals emphasize limiting human activities to what nature can afford. Only by effectively utilizing natural resources and maintaining the coordinated development of the natural environment and social economy can the goal of ecologically sustainable development be realized [2].
The ecological footprint concept was first proposed in 1992 by Ree [3], and then Wackemagel developed it into the ecological footprint model [4]. The model quantifies the consumption and occupation of natural capital by human activities in biologically productive land area and directly expresses the occupation degree of natural capital by human beings [5,6]. Therefore, it is very effective to evaluate ecological sustainability based on this model [7]. However, traditional ecological footprint models only calculate the size of natural capital flow without separating capital flow and capital stock, which cannot reflect the role of natural capital stock on ecological balance [8]. So, Niccolucci [9] introduced the ecological footprint size (EF size ) and ecological footprint depth (EF depth ) to construct a three-dimensional ecological footprint model (3DEF), and the spatial and temporal variation characteristics of global ecological footprint size and depth from 1961 to 2006 were analyzed using this model [10]. The 3DEF model was introduced by Kai Fang for the first time to analyze the capital utilization patterns of Chinese provinces [11]. Fang [12] comprehensively interpreted the EF size and the EF depth and the results showed that we could analyze whether human consumption is overloaded from both horizontal and vertical perspectives by using the 3DEF model. The model could be a new method to study ecological sustainable development. Then, Fang [13] analyzed the spatial variation characteristics of natural capital utilization in G20 countries from 1999 to 2008 and found that the traditional three-dimensional ecological footprint model has the problem of offsetting the regional deficit. To overcome this problem, Fang [14] modified the model to obtain a revised 3DEF model and used it to study the characteristics of natural capital utilization in 11 countries.
Currently, the 3DEF model has been widely used to evaluate the ecological sustainability of different scale study areas, such as the national scale, the provincial scale, and the urban agglomeration scale. On the national scale, Fang [13] found that resource-rich countries have higher EF size and lower EF depth ; that is, they have higher capital flow and lower capital stock, and the prospect of ecological sustainable development is limited by resource endowment and the economic development level. In addition, renewable resources might restrict the utilization efficiency of natural capital flow, and there is a significant negative correlation between the consumption of natural capital stock and the level of social and economic development [14]. On the provincial scale, Wang et al. [15] measured the three-dimensional ecological footprint of 12 cities in Inner Mongolia from 2010 to 2016 and examined the driving factors. The results showed that there was over-utilization of resources. The determinants of ecological surplus/deficit were not only the natural endowment but also population density, industrial structure, and the technological level. Based on the revised 3DEF model, Wu [16] analyzed the sustainability and decoupling of natural capital utilization in 30 provinces of China from the two dimensions of capital flow and stock and believed that increasing footprint scale and decreasing footprint depth are conducive to ecologically sustainable development. On the urban agglomeration scale, in Du's research [17], the EF depth was influenced by the quantity and structure of energy consumption and had an inverted "N"-shaped relationship with economic development. Wang et al. [18] conducted PLS modeling with the EF depth as the explained variable and socioeconomic indicators as the explanatory variables and found that the natural capital utilization patterns of the Guangdong-Hong Kong-Macao Greater Bay Area could be divided into four categories. Ecological sustainability was best when capital stock consumption was reduced and capital flow was abundant. Additionally, Yang et al. [19] and Chen et al. [20] showed that evaluating the ecological sustainability of urban agglomerations by the 3DEF model is reliable.
Overall, the use of the 3DEF model to evaluate ecological sustainability has been quite mature. However, due to the nonlinear relationship between ecological footprint indicators and socioeconomic indicators [21], the high number of features, and the small sample sizes [22], there are few studies on the influencing factors of ecological sustainability from the perspective of data mining. Fortunately, the random forest method is not dependent on the sample size, and the OOB algorithm with the importance of measure variables extracts multiple samples from the original sample through the bootstrap resampling method [23], which is a data mining method that can overcome the nonlinear relationship and poor data information [24].
With the Chengdu urban agglomeration (CUA) as an example, this work is a preliminary attempt to remedy these gaps by investigating ecological sustainability from the standpoint of machine learning (ML). As a starting point, we used the 3DEF model to determine the EF size and EF depth of the study region. Using the two indicators, the study area's ecologically sustainable types can then be segmented. The random forest technique was finally established to pinpoint the variables that affect ecological sustainability. The following are some possible innovations from this study: (1) The factors affecting ecological sustainability were initially discussed using footprint methods and machine learning; (2) our research methodology in this paper offers a new way to investigate the factors affecting the ecological sustainability of urban agglomeration; and (3) our study may serve as a guide for the analysis of ecological footprint indicators in the case of small samples.

Study Area
The Chengdu urban agglomeration (CUA) is located in western China. It includes eight cities, with Chengdu as the center. The overall terrain of the CUA is flat, dominated by plains, basins, and hills. As the core area of Sichuan Province's multi-point and multi-polar support development strategy, it plays a vital role in the economic development of Sichuan Province. At the end of 2020, the regional land area was about 78,000 square kilometers, with a permanent population of 38.518 million and a GDP of RMB 2829.56 billion.

Data Sources
This study uses the Chengdu urban agglomeration as the research object and collected socioeconomic and land use data in 4 years (2000, 2010, 2015, and 2019). Among them, the socioeconomic data comes from the statistical yearbooks of various cities, and the land use data and administrative division vector data come from the Resource Environment and Science Data Center of the Institute of Geographical Sciences (https: //www.resdc.cn/Default.aspx, accessed on 8 July 2022). In the ecological footprint calculation, the equilibrium and yield factors were determined by referring to existing research results [25,26], as shown in Table 1. According to the scale characteristics of the study area, the consumption account of biological resources was updated from "global hectare" to "provincial hectare", that is, the average output of various consumer goods in Sichuan Province. According to The General Rules for Calculation of China's Comprehensive Energy Consumption (GB/T2589-2008), the energy consumption is converted into the area of fossil energy land and building land based on the low calorific value generated per kilogram of fossil fuel, as shown in Table 2. Since economic, social, and environmental factors impact the use of natural capital [16], this paper selects nine elements, as shown in Table 3. Note: index data with * was calculated in global hectares.

Methods
In this study, the improved three-dimensional ecological footprint model was used to determine the ecological footprint size (EF size ), ecological footprint depth (EF depth ), and three-dimensional ecological footprint (EF 3D ) of 8 cities in the Chengdu urban agglomeration in 2000, 2010, 2015, and 2019. First, the EF size and EF depth were used to assess the research area's ecological sustainability. Then, using the random forest OOB algorithm, the Chengdu urban agglomeration's ecological sustainability impact elements were discovered and examined. The two sections that make up the research framework for this paper are (1) evaluating ecological sustainability and (2) identifying the influencing elements ( Figure 1).

Methods
In this study, the improved three-dimensional ecological footprint model was used to determine the ecological footprint size (EFsize), ecological footprint depth (EFdepth), and three-dimensional ecological footprint (EF3D) of 8 cities in the Chengdu urban agglomeration in 2000, 2010, 2015, and 2019. First, the EFsize and EFdepth were used to assess the research area's ecological sustainability. Then, using the random forest OOB algorithm, the Chengdu urban agglomeration's ecological sustainability impact elements were discovered and examined. The two sections that make up the research framework for this paper are (1) evaluating ecological sustainability and (2) identifying the influencing elements ( Figure 1).

Three-Dimensional Ecological Footprint Model
The ecological footprint model has experienced the evolution from a one-dimensional ecological footprint to two-dimensional and three-dimensional models (See the Figure 2).
A one-dimensional ecological footprint converts biological resources into the land area to quantify human utilization of natural resources [27]. The calculation formula for one-dimensional ecological footprint is as follows.
where e f is the per capita ecological footprint (hm 2 /cap); EF is the ecological footprint (hm 2 ); r j is the equivalence factor; Y i is the average product of item i; C i is the consumption of item i.

Three-Dimensional Ecological Footprint Model
The ecological footprint model has experienced the evolution from a onedimensional ecological footprint to two-dimensional and three-dimensional models (See the Figure 2). A one-dimensional ecological footprint converts biological resources into the land area to quantify human utilization of natural resources [27]. The calculation formula for one-dimensional ecological footprint is as follows.
where ef is the per capita ecological footprint (hm 2 /cap); EF is the ecological footprint (hm 2 ); j r is the equivalence factor; i Y is the average product of item i ; i C is the consumption of item i .
A two-dimensional ecological footprint increases the calculation of ecological carrying capacity. The difference between ecological footprint and ecological carrying capacity (i.e., ecological profit and loss) is used to determine whether the ecological footprint can meet the needs of human production activities. The calculation formula for a two-dimensional ecological footprint is as follows.
where ec is the per capita ecological carrying capacity (hm 2 /cap); EC is the ecological carrying capacity (hm 2 ); ED is the ecological profit and loss (hm 2 ); j is the land type; j a is the per capita area of land j ; and j y is the yield factor. A two-dimensional ecological footprint increases the calculation of ecological carrying capacity. The difference between ecological footprint and ecological carrying capacity (i.e., ecological profit and loss) is used to determine whether the ecological footprint can meet the needs of human production activities. The calculation formula for a twodimensional ecological footprint is as follows.
where ec is the per capita ecological carrying capacity (hm 2 /cap); EC is the ecological carrying capacity (hm 2 ); ED is the ecological profit and loss (hm 2 ); j is the land type; a j is the per capita area of land j; and y j is the yield factor. The three-dimensional ecological footprint model also introduces two indicators of footprint breadth and depth to quantify the relationship between natural capital stock and flow on a two-dimensional basis [9]. Based on the research of Chinese scholar Fang Kai, a revised three-dimensional ecological footprint model was obtained [14]. The calculation formula for the fixed three-dimensional ecological footprint is as follows.
where EF size is the ecological footprint size, which indicates the size of natural capital flow; EF depth is the depth of ecological footprint, which represents the size of natural capital stock; and EF 3D is the three-dimensional ecological footprint. Obviously, in the Equation (7), when the EF i ≤ EC i , the EF depth is the original length "1", which means the capital flow is surplus.

The OOB Algorithm in Random Forest
Random forest is a statistical learning theory. It uses the bootstrap re-sampling method to extract multiple samples from the original samples, conducts decision tree modeling for each bootstrap sample, and then combines the predictions of numerous decision trees to obtain the final prediction result through voting [28,29]. The random forest can be well used to evaluate the importance of variables [30] and is widely used in ecology [31].
There are usually Gini importance and mean square error reduction methods for variable importance measurement using random forest, among which the calculation steps of the mean square error reduction method are as follows.
Step 1: Calculate the mean square error (MSE) of each decision tree's out-of-bag data (OOB), and the calculation formula is as follows.
Step 2: Replace the target variables randomly and calculate the new mean square deviation. The calculation formula is as follows.
Step 3: The importance measure of variables was calculated based on the mean square deviation before and after replacement, and the calculation formula is as follows: where in the Equations (9)- (12), N t is the number of cities in the tree with OOB data;ŷ i,t is the predicted value of the dependent variable of the city under the tree;ŷ i,t (ν) is the predicted value of the dependent variable of the city under the new tree after random substitution of variables; V I(ν) is the importance of variables; and R(ν) is the variable importance ratio.

A Combination of the Two Approaches
Ecological footprint size (EF size ) and depth (EF depth ) of the study area can be obtained through the three-dimensional ecological footprint model (Equations (1)- (7)). These two variables are taken as explained variables, and the indicators (X1, . . . , X9 in Table 3) representing the three aspects of economy, society, and environment are taken as explanatory variables. Then, we conducted random forest regression model fitting to investigate the explanatory ability of indicators and then calculated the importance proportion of all variables (X1, . . . , X9) based on the OOB algorithm (see "Section 2.3.2") so as to complete the task of identifying influencing factors.

Ecological Footprint Size
The ecological footprint size represents the human occupation of natural capital flow. As shown in Figure 3, the per capita EF size of each city showed an overall increasing trend over time, but the value of per capita EF size varies significantly among cities. In 2019, the natural capital flows of Ziyang City, Deyang City, and Mianyang City were more fully occupied, with per capita EF size exceeding 0.5 hm 2 . It is worth noting that the per capita EF size of Ziyang City changed the most from 2000 to 2019, while the other seven cities had little change, and the per capita EF size values for Chengdu City and Leshan City were always within the range of 0.2-0.4 hm 2 .
Further analysis of the EF size of each land type (as shown in Figure 4) found that the EF size ratio of cultivated land in all cities was the largest, and the EF size ratio of cultivated land in other cities is more than 90%, except Ya'an City. It means that the regional development of the CUA is highly dependent on cultivated land. However, the proportion of EF size in forests, grazing lands, fishing grounds, and built-up areas varies among cities. Except for the EF size proportion of forests in Ya'an City increasing significantly, the EF size proportion of different land types remained relatively stable from the perspective of time until 2019. Therefore, the EF size of different kinds of land in each city in 2019 can be analyzed in detail. In 2019, the proportion of the EF size of croplands was the largest, with the highest being Ziyang City (96.09%) and the lowest being Ya'an City (45.41%). It is followed by forest EF size (Ya'an City is the highest at 43.99%, and Ziyang City is the lowest at 2.64%), grazing lands (Ya'an City is the highest at 8.59%, and Ziyang City is the lowest with 0.11%), built-up areas (Leshan City is the highest with 1.74%, and Mianyang City is the lowest with 0.35%), fishing grounds (Leshan City is the highest with 0.57%, and Deyang City is the lowest with 0.15%). In general, these four land types have little influence on the ecological footprint size of the CUA. ) (ν VI is the importance of variables; and ) (ν R is the variable importance ratio.

A Combination of the Two Approaches
Ecological footprint size (EFsize) and depth (EFdepth) of the study area can be obtained through the three-dimensional ecological footprint model (Equations (1)- (7)). These two variables are taken as explained variables, and the indicators (X1, …, X9 in Table 3) representing the three aspects of economy, society, and environment are taken as explanatory variables. Then, we conducted random forest regression model fitting to investigate the explanatory ability of indicators and then calculated the importance proportion of all variables (X1, …, X9) based on the OOB algorithm (see "Section 2.3.2") so as to complete the task of identifying influencing factors.

Ecological Footprint Size
The ecological footprint size represents the human occupation of natural capital flow. As shown in Figure 3, the per capita EFsize of each city showed an overall increasing trend over time, but the value of per capita EFsize varies significantly among cities. In 2019, the natural capital flows of Ziyang City, Deyang City, and Mianyang City were more fully occupied, with per capita EFsize exceeding 0.5 hm 2 . It is worth noting that the per capita   Further analysis of the EFsize of each land type (as shown in Figure 4) found that the EFsize ratio of cultivated land in all cities was the largest, and the EFsize ratio of cultivated land in other cities is more than 90%, except Ya'an City. It means that the regional development of the CUA is highly dependent on cultivated land. However, the proportion of EFsize in forests, grazing lands, fishing grounds, and built-up areas varies among cities. Except for the EFsize proportion of forests in Ya'an City increasing significantly, the EFsize proportion of different land types remained relatively stable from the perspective of time until 2019. Therefore, the EFsize of different kinds of land in each city in 2019 can be analyzed in detail. In 2019, the proportion of the EFsize of croplands was the largest, with the highest being Ziyang City (96.09%) and the lowest being Ya'an City (45.41%). It is followed by forest EFsize (Ya'an City is the highest at 43.99%, and Ziyang City is the lowest at 2.64%), grazing lands (Ya'an City is the highest at 8.59%, and Ziyang City is the lowest with 0.11%), built-up areas (Leshan City is the highest with 1.74%, and Mianyang City is the lowest with 0.35%), fishing grounds (Leshan City is the highest with 0.57%, and Deyang City is the lowest with 0.15%). In general, these four land types have little influence on the ecological footprint size of the CUA.

Ecological Footprint Depth
The EFdepth represents the consumption of the natural capital stock. Only Ya'an's EFdepth is always at the original length, while the other cities exceed the actual length ( Figure 5), which means that only Ya'an's natural capital flow can meet the regional development needs. Meanwhile, much of the natural capital stock has been consumed in the remaining

Ecological Footprint Depth
The EF depth represents the consumption of the natural capital stock. Only Ya'an's EF depth is always at the original length, while the other cities exceed the actual length ( Figure 5), which means that only Ya'an's natural capital flow can meet the regional development needs. Meanwhile, much of the natural capital stock has been consumed in the remaining seven cities. There are apparent differences in EF depth values among cities. Specifically, the EF depth of Mianyang is lower than 10, and the value of Leshan's EF depth is between 6 and 11. The EF depth values in Deyang and Chengdu ranged from 16 to 26, and Meishan and Suining were between 30 and 50. Ziyang had the highest EF depth at 61. The difference in EF depth indicates the difference in capital stock consumption and unsustainable development level in different cities. In terms of time, the development trend of EF depth in the eight cities is also different. The average annual change of EF depth showed an increasing trend of seven cities excluding Ya'an. The average annual growth rates were as follows: Leshan (6.60%), Mianyang (5.79%), Ziyang (5.04%), Meishan (5.04%), Chengdu (4.85%), Suining (3.08%), and Deyang (2.73%).    Table 4 shows the EF depth exploration of five land types (excluding carbon capture land) in 2000 and 2019. The EF depth of croplands, built-up areas, and forests (excluding Meishan Ziyang, Deyang, and Chengdu) remains 1, which shows that under the condition of the overall urban ecological deficit, the forests and built-up areas have an ecological surplus and are in a sustainable development state. Combined with the growth of the built-up areas in each city, it shows that the expansion of built-up areas and the strengthening of industrialization in urbanization can alleviate the ecological pressure of built-up areas to a certain extent. However, the EF depth of other land types showed overdevelopment, and the difference in the EF depth of grazing land was the largest. The variation coefficient of EF depth of grazing land in 8 cities increased from 88.79% to 94.3% (From 2000 to 2019), which indicates that the consumption of natural capital stock of grazing land is large and different among cities.

Three-Dimensional Ecological Footprint
The results of the three-dimensional ecological footprint of the CUA in 4 years are shown in Table 5. Specifically, only Chengdu presents a downward trend, declining by 8.32%. On the contrary, the other seven cities have a more substantial increase, as follows: Ziyang (251.77%), Leshan (126.56%), Mianyang (113.08%), Meishan (88.82%), Suining (72.74%), Ya'an (66.56%), and Deyang (50.81%). Therefore, we can infer that the characteris-tics of comprehensive utilization of regional resources in Chengdu urban agglomeration are as follows: Chengdu is the core of the radial development, and Chengdu's industrial migration makes the surrounding cities develop rapidly. Furthermore, especially in 2016, Chengdu incorporated Jianyang city, an area under the jurisdiction of Ziyang city, into its administrative region.

Classification of Urban Agglomeration Ecological Sustainability
According to the standardized size relationship of the EF size and EF depth ( Figure 6) and the systematic clustering results of standardized data, the ecological sustainability of 8 cities in the study area was intuitively divided into four types: Furthermore, especially in 2016, Chengdu incorporated Jianyang city, an area under the jurisdiction of Ziyang city, into its administrative region.

Classification of Urban Agglomeration Ecological Sustainability
According to the standardized size relationship of the EFsize and EFdepth ( Figure 6) and the systematic clustering results of standardized data, the ecological sustainability of 8 cities in the study area was intuitively divided into four types: Type 1: both the EFsize and EFdepth are high, indicating high natural capital utilization and massive capital stock consumption. Cities in this category have the most extraordinary ecological environment pressure and the lowest degree of ecological sustainability.
Type 2: the EFsize is low and the EFdepth is moderate, manifested by the reasonable utilization of natural capital and the consumption rate of capital stock is higher than that of capital flow. These cities are facing more significant pressure from regional development and have a low degree of ecological sustainability.
Type 3: both the EFsize and EFdepth are moderate, which shows that the utilization rate of natural capital flow is higher than the utilization rate of the stock. These cities have high ecological sustainability Type 4: the EFsize is moderate, and the EFdepth is low, manifested by lagging utilization of natural capital stock and dominated by capital flow utilization, these cities have the highest ecological sustainability. Figure 6. Quadrant scatter plots of the relationship between regional footprint depth and regional footprint size of each city. Figure 6. Quadrant scatter plots of the relationship between regional footprint depth and regional footprint size of each city. Type 1: both the EF size and EF depth are high, indicating high natural capital utilization and massive capital stock consumption. Cities in this category have the most extraordinary ecological environment pressure and the lowest degree of ecological sustainability.
Type 2: the EF size is low and the EF depth is moderate, manifested by the reasonable utilization of natural capital and the consumption rate of capital stock is higher than that of capital flow. These cities are facing more significant pressure from regional development and have a low degree of ecological sustainability.
Type 3: both the EF size and EF depth are moderate, which shows that the utilization rate of natural capital flow is higher than the utilization rate of the stock. These cities have high ecological sustainability Type 4: the EF size is moderate, and the EF depth is low, manifested by lagging utilization of natural capital stock and dominated by capital flow utilization, these cities have the highest ecological sustainability.
As shown in Figure 7, obviously, during the study period (2000-2019), the ecological sustainability of the Chengdu urban agglomeration became worse, and some cities' natural capital utilization types also changed significantly. For example, Chengdu changed from type 4 to type 2, and Ziyang changed from type 3 to type 1. The intensification of capital stock consumption led to a downward trend of regional ecological sustainability [32]. Furthermore, regarding geographical location, ecological sustainability is low, mainly concentrated in the central cities (such as Chengdu and Ziyang). In contrast, ecological sustainability is high in the north and south (in cities such as Mianyang, Ya'an, and Leshan). The spatial distribution characteristics of resource endowments in this region are consistent [33]. As shown in Figure 7, obviously, during the study period (2000-2019), the ecological sustainability of the Chengdu urban agglomeration became worse, and some cities' natural capital utilization types also changed significantly. For example, Chengdu changed from type 4 to type 2, and Ziyang changed from type 3 to type 1. The intensification of capital stock consumption led to a downward trend of regional ecological sustainability [32]. Furthermore, regarding geographical location, ecological sustainability is low, mainly concentrated in the central cities (such as Chengdu and Ziyang). In contrast, ecological sustainability is high in the north and south (in cities such as Mianyang, Ya'an, and Leshan). The spatial distribution characteristics of resource endowments in this region are consistent [33].

Identification Results of Influencing Factors
The nine indicators related to economy, society, and environment are selected (X1, X2, …, X9) as explanatory variables. Natural logarithms of the EFsize and the EFdepth were used as explained variables for random forest regression model fitting and the importance ratio (Table 6). Table 6 shows the OOB measurement results of 2000, 2010, 2015, 2019, the four years as a whole, and the corresponding goodness-of-fit R 2 of the model. First, all R 2 values are more significant than 0.7, indicating that all models are valid. Second, for footprint breadth, the importance of economic and social indicators for the EFsize increased from 2000 to 2019. The volume of economic indicators rose from 16.0% to 24.2%, and the importance of social indicators increased from 19.4% to 37.4%. However, the importance of environmental indicators decreased from 64.4% to 38.4%. Third, for the EFdepth, the situation changed significantly. The volume of environmental indicators has increased dramatically, from 40.4 percent in 2000 to 72.9 percent in 2019. On the other hand, the importance of economic and social indicators decreased significantly. Fourthly, according to the importance ratio of the accurate data, the three indexes that have the most significant impact on the EFsize are X6 (21.8%), X9 (20.3%), and X4 (15.4%), with a cumulative ratio of more than 50%. The three indexes that have the most significant

Identification Results of Influencing Factors
The nine indicators related to economy, society, and environment are selected (X1, X2, . . . , X9) as explanatory variables. Natural logarithms of the EF size and the EF depth were used as explained variables for random forest regression model fitting and the importance ratio (Table 6). Table 6 shows the OOB measurement results of 2000, 2010, 2015, 2019, the four years as a whole, and the corresponding goodness-of-fit R 2 of the model. First, all R 2 values are more significant than 0.7, indicating that all models are valid. Second, for footprint breadth, the importance of economic and social indicators for the EF size increased from 2000 to 2019. The volume of economic indicators rose from 16.0% to 24.2%, and the importance of social indicators increased from 19.4% to 37.4%. However, the importance of environmental indicators decreased from 64.4% to 38.4%. Third, for the EF depth , the situation changed significantly. The volume of environmental indicators has increased dramatically, from 40.4 percent in 2000 to 72.9 percent in 2019. On the other hand, the importance of economic and social indicators decreased significantly. Fourthly, according to the importance ratio of the accurate data, the three indexes that have the most significant impact on the EF size are X6 (21.8%), X9 (20.3%), and X4 (15.4%), with a cumulative ratio of more than 50%. The three indexes that have the most significant influence on the EF depth are X8 (35.8%), X9 (13.4%), and X3 (14.0%), which are the three indexes with the most significant importance, and the accumulative proportion exceeds 60%. It can be seen that, on the whole, environmental factors in the study area have the most significant impact on ecological sustainability. From the point of view of data characteristics, the EF size and the EF depth measured by the 3DEF model are numerical values with exponential properties, and there is a complex nonlinear relationship between a series of indicators of the economy, society, and environment, so the traditional factor identification method is invalid [34]. Therefore, previous studies just used the 3DEF model to measure ecological sustainability indicators [35] and conducted a simple descriptive statistical analysis of the measurement results [17]. The random forest can overcome the nonlinear relationship between variables [36]. It is meaningful to combine the measurement results of 3DEF model with the random forest. Fortunately, the R 2 of the model obtained in Table 6 is very high, ranging from 0.75 to 0.90, indicating that this algorithm is indeed feasible.

The Universality of the Method
Computing the loss reduction on the out-of-bag (OOB) instead of the in-bag training samples makes the variable importance measurement unbiased [37]. So, the value of R 2 increases gradually with time, implying that the random forest algorithm selected in this paper successfully identifies the factors affecting the ecological sustainability of urban agglomeration and has extensibility. Moreover, due to the extremely high ecological fragility of the Chengdu urban agglomeration, environmental protection is the primary measure to maintain and improve ecological sustainability [38,39]. That is to say, the realistic results also confirm the rationality of our method. In addition, whether the random forest is used to determine the key attributes of the fishery improvement projects (FIPs) [40] or obtain the importance measure of single and group variables, it has achieved good results [41]. In particular, the random forest has universal applicability to urban environmental problems, for example, the study of urban impervious surface extraction [42], research on the impact of spatial scale on urban ecological environment and human activities [43], and so on.

The Main Factors Affecting Ecological Sustainability
Among the three influencing factors of economy, society, and environment, the environmental factor has become the main influencing factor of ecological sustainability. The social and economic factors have more and more influence on utilizing natural capital flow. The research of this paper can provide the following two aspects of exploring the ecologically sustainable development and management of urban agglomeration. First, managers should focus on improving the utilization efficiency of natural capital flow to enhance the ecological sustainability of urban agglomeration. Industrial wastewater discharge (X6) and green coverage of built-up areas (X9) are significant to the EF size . The water environment resources are an essential source of natural capital flow. Reducing industrial wastewater discharge in cities is conducive to protecting water environment resources, and the utilization efficiency of water resources will be improved [44]. Land resources are also essential donors of natural capital flow.
The improvement of green coverage in built-up areas can enhance the resilience of the urban ecological environment and the efficiency of land use [45]. With the acceleration of urbanization, human demand for natural capital increases, even if the utilization efficiency of natural capital flow is improved. Because the acceleration of urbanization makes consumption of the capital stock faster, urban ecological sustainability still faces a severe test [46]. Second, we could explore measures to balance the accumulation of natural capital and stock consumption to promote the ecological sustainability of urban agglomeration. Industrial smoke and dust emission (X8) and green coverage of built-up areas (X9) are the main influencing factors of the EF depth . If we reduce emissions of pollutants, we can increase the accumulation of natural capital and thus increase the consumptive capacity of the capital stock [47]. Urban green space promotes ecosystem supply and regulation services [48]. The surge in population size in urban agglomerations brings a particular burden to ecological carrying capacity [49,50]. Therefore, maintaining the appropriateness of urban population size can alleviate the consumption of natural capital stock [51]. A suitable factor identification method is the cornerstone of a comprehensive evaluation study [52], and the research method in this paper may provide a basis for constructing an evaluation system for regional sustainable development research.

Limitations and Extensions of this Study
The study has several limitations. First, there are limitations to land use data used for ecological footprint accounting, such as low spatial and temporal resolution of data or high costs and long periods [53]. In fact, in future research, we may combine remote sensing interpretation, the Land-Parcel Identification System (LPIS), and the original Public Land Survey (PLS) in small areas to obtain high-accuracy data. Second, in the selection of indicators, the method of literature research has certain coverage limitations. In future studies, statistical methods such as structure equation modeling (SEM) and principal component analysis (PCA) can be combined to make the selection of indicators more comprehensive and objective. Thirdly, we need to further narrow the administrative scale of the research area (for example, take towns or streets as research objects) to make the research conclusions more targeted and the policy suggestions more operable. Finally, this study is the first to combine footprinting and machine learning methods despite some limitations.

Conclusions
Taking the Chengdu urban agglomeration as the research object, this paper first calculates the breadth and depth of the ecological footprint of this region by using the three-dimensional ecological footprint model, then divides the ecological sustainability types of the urban agglomeration according to it. Then it introduces the random forest OOB algorithm to identify the influencing factors of ecological sustainability and finally draws the following conclusions: (1) The ecological sustainability of the study area was divided into four categories. (a) The first category, the least ecologically sustainable, is characterized by high utilization of natural capital and massive consumption of capital stock. In this category, cities (such as Ziyang and Meishan in 2019 and Meishan in 2010) face tremendous ecological pressure and unsustainable risks.
Category two has low ecological sustainability because of the moderate use of natural capital and faster consumption of capital stock than flow, and cities (such as Chengdu in 2010, 2015, and 2019) are facing more significant pressure from regional development. As a result, they have a low degree of ecological sustainability. (c) The third category (with cities such as Suining Deyang, and Meishan in 2000, 2015, and 2019) has high ecological sustainability and is characterized by the utilization rate of natural capital flow being higher than the rate of stock consumption. (d) The last category (with cities such as Leshan and Ya'an in 2000, 2010, 2015, and 2019) has the highest ecological sustainability, which means the natural capital stock consumption lags, and the capital flow utilization leads.
(2) The environment (the average importance ratio is 58.2%) is the main aspect affecting the ecological sustainability of urban agglomerations, among which the discharge of industrial wastewater, industrial smoke (powder) dust, and the green space of builtup areas are the most important. Therefore, we propose to improve the utilization efficiency of natural capital flow and the consumption resistance of stock by strictly controlling the discharge of industrial waste water and industrial smoke (powder) dust. The improvement of urban ecological sustainability can be used as a reference for evaluating the efficiency of urban environmental management. (3) Social (the average importance ratio is 25.9%) and economic (the average importance ratio is 15.9%) aspects also impact the ecological sustainability of urban agglomerations, especially on natural capital accumulation and stock consumption. At the same time as accelerating urbanization, maintaining the appropriateness of population size and enlarging urban green space can improve ecological sustainability. Furthermore, it is suggested to strengthen urban infrastructure construction, especially the GI (green infrastructure), to promote high-quality economic development and improve people's living standards. (4) The random forest OOB algorithm overcomes the nonlinearity between the ecological footprint index and the economy-society-environment index. The model accuracy is higher than that of a traditional regression model. In the study of environmental assessment and management, the combination of machine learning methods and footprinting methods is feasible and reliable.  Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: Not applicable.

Conflicts of Interest:
The authors declare no conflict of interest.