Article

September 30, 2026

Sustainable Machine Learning: CO2 Emissions in Decision Tree Algorithms

Sustainable Machine Learning: CO2 Emissions in Decision Tree Algorithms

Bruno Fernando da Silva; Mario Henrique Bueno Moreira Callefi

DOI: 10.22167/2675-6528-202602734

Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.

Summary

The growing use of machine learning algorithms has intensified the debate on environmental cost, especially during model training. This study compared the predictive performance and estimated carbon dioxide emissions during the training of different decision tree-based algorithms. Experiments were conducted with the “Forest Cover Type” dataset, which featured multiclass classification and imbalance. Algorithms such as simple classification tree, random forest, XGBoost, and LightGBM were evaluated, considering variations in data subsets and hyperparameters. CO2 emissions were estimated by the CodeCarbon library, and balanced accuracy assessed predictive performance. It was observed that increased model complexity and data scale consistently elevated CO2 emissions. Exhaustive hyperparameter tuning procedures significantly increased the energy cost of training without proportional performance gains. Among the algorithms, LightGBM presented a favorable balance between accuracy and emissions, while XGBoost achieved the highest predictive performance with higher average energy consumption. The results indicated a trade-off between performance and environmental impact, which intensifies with high accuracies. Decisions on algorithm choice, hyperparameter configuration, and data scale can influence the computational sustainability of machine learning models.

Keywords: Predictive performance; Computational efficiency; Artificial intelligence; Carbon footprint.

1. Introduction

Sustainability represents a fundamental pillar in the contemporary challenges of technological development. In this context, the continuous degradation of matter and energy, which transition from available to unavailable states, establishes biophysical limits for resource utilization in technological production (Georgescu-Roegen, 1971). The discussion on sustainability transcends the purely economic scope, configuring itself as a matter of justice and human rights, given that the preservation of ecosystems is crucial for the survival of future generations (Silva and Silva, 2025).

In the field of machine learning, the increasing use of algorithms has intensified the debate about the environmental cost associated with training models. Carbon emissions into the atmosphere, often resulting from the burning of fossil fuels for energy generation, are a concerning factor (Strubell et al., 2019). Although researchers seek increasingly accurate models, energy consumption is not always considered a relevant factor. However, evaluating energy consumption is essential to ensure the scalability and sustainability of the technology (García-Martín et al., 2019). A model’s carbon footprint is influenced by electricity consumption during training and the emission factor of the local energy matrix, as well as by the algorithm and the number of processors involved (Patterson et al., 2021). Tools like the CodeCarbon library can estimate carbon dioxide emission metrics per unit of energy (Bouza et al., 2023), but there are still few studies and insufficient incentives for sustainability assessments focused on indirect carbon emissions (van Wynsberghe, 2021).

The variability in computational architectures and algorithms hinders the detection of energy consumption patterns in machine learning (Bernardo et al., 2020). Furthermore, the pursuit of higher accuracy, which frequently involves optimization cycles and hyperparameter adjustments, known as tuning, can multiply energy consumption during the initial training of algorithms (Strubell et al., 2019). In computational workloads that use decision trees, the iterative process of impurity calculation and the split decision for each new tree node are the main elements that influence computational cost (Ferro et al., 2023).

Decision trees are widely employed due to their flexibility in handling non-linear problems, their applicability to categorical and numerical variables, and their ability to generate easily interpretable results (De’ath and Fabricius, 2000). Ensemble methods, such as random forests, combine multiple independently trained decision trees to achieve higher accuracy, following the principle of Bagging (Breiman, 1996; Breiman, 2001). Boosting, on the other hand, used in algorithms like LightGBM, combines simple models sequentially to improve final accuracy, standing out for its training speed and focus on main leaves (Sruthi, 2021; Ma et al., 2018). Regardless of the model, hyperparameter configuration is crucial for execution and performance optimization, being performed based on literature, experience, or trial and error (Probst et al., 2019).

Given this scenario, it becomes essential to deepen the knowledge about the impacts of the extensive use of machine learning algorithms and how model variables can influence energy consumption and carbon emissions. Best practices can be adopted to promote sustainability in the use of artificial intelligence. Sustainability in machine learning is not limited to emission reduction but encompasses the pursuit of greater efficiency in the relationship between computational resources and performance. This perspective expands the traditional evaluation of models, which focuses mainly on predictive performance, to include energy consumption and carbon emissions as additional dimensions of computational efficiency (van Wynsberghe, 2021). Thus, a model with a small performance advantage that requires significantly more computational resources may not be the most efficient alternative from a sustainability perspective. Given the presented context, this research aims to compare CO2 emission estimates and predictive performance between decision tree algorithms in a classification problem, investigating the hypotheses of a trade-off between performance and environmental impact and that relatively high increases in emissions during model training may result in only marginal performance gains depending on the context.

2. Material and Methods

The research was exploratory in nature, conducted through an experimental study. The central objective was to observe the energetic impact and predictive performance when varying the size of the dataset and the complexity of different decision tree-based classification models. This approach allowed for the investigation of the relationship between predictive performance and carbon dioxide emissions, as per the study’s objective. The controlled manipulation of observations and variables was fundamental to the analysis.

The experiments were performed on a local machine with an x64 architecture and without a graphics processing unit (GPU). The computational environment specifications included an AMD Ryzen 5 1600 @ 3.2GHz processor, with six cores and twelve threads, 8 GB of RAM, and the Windows 10 operating system. For the calculation of energy consumption and CO2 emissions, the CodeCarbon tool was used, which is a Python library. This tool tracks the code snippet of interest and generates a .csv file with estimates of energy consumed in kilowatt-hours (kWh) and carbon dioxide emissions in grams (gCO2).

The CO2 emissions estimate was obtained by multiplying the total energy consumption by the carbon intensity coefficient of the local energy matrix of execution. For Brazil, with data from 2023, the calculated coefficient was 98.348 gCO2 kWh⁻¹. For comparative purposes, CodeCarbon adopts a standard of 475 gCO2 kWh⁻¹ when local data is not available. Energy consumption measurements focus on CPU and GPU activity, although other components such as memory and motherboard also contribute (Ukarande et al., 2024).

The dataset employed was the “Forest Cover Type Dataset” (Blackard & Dean, 1999), obtained from the UCI Machine Learning Repository. This tabular dataset is used for classification problems, with the forest cover type as the target variable. The predictor variables are of an environmental and geographical nature, including terrain elevation, area slope, and distances to roads and water bodies. The complete dataset contained approximately 581,000 observations, distributed across seven distinct classes.

Classes one and two concentrated about 85% of the observations, characterizing a scenario of imbalance that required adequate evaluation metrics. The explanatory variables were composed of ten numerical and two categorical variables, which were represented in “dummy” format, totaling 44 distinct types. The use of a single dataset, even with variations in sampling, is a recognized limitation, as the results may depend on the specific characteristics of the data.

The experimental pipeline was standardized for all evaluated models, ensuring the comparability of results. The steps consisted of reading the dataset, followed by separation into training and testing sets, using a ratio of 80% for training and 20% for testing. Subsequently, model training was performed, its performance evaluated on the test set, and finally, hyperparameter adjustment, known as “tuning”.

To evaluate the impact of data scale on energy consumption, subsets of the original dataset were created, containing 5,000, 25,000, 100,000, and 300,000 observations. The selection of these samples was performed randomly and stratifiably, preserving the original class proportion in each subset. No normalization or standardization techniques were applied to the variables, as decision tree-based algorithms are not sensitive to attribute scale. Energy consumption monitoring was restricted to the training and “tuning” stages of the models.

Four supervised learning algorithms based on decision trees were evaluated. The simple classification tree served as a baseline model, with its complexity controlled by varying the maximum tree depth (max_depth) at 5, 10, and 20. The classification random forest (Breiman, 1996; Breiman, 2001) had configurations evaluated with 10 and 100 estimators (n_estimators) and maximum depths of 5 and 20. The “XGBoost Classifier” and “LightGBM Classifier” (Ma et al., 2018; Sruthi, 2021) were also included, with XGBoost testing 10 and 100 estimators and maximum depths of 5 and 20. For LightGBM, complexity was controlled by the number of leaves (num_leaves) at 31 and 127, and by the number of estimators at 10 and 100. The selection of these hyperparameters aimed to represent different levels of complexity and maintain the computational feasibility of the experiments (Probst et al., 2019).

The hyperparameter values were evaluated across all sample sizes. Cost-complexity pruning (ccp_alpha) and grid search techniques were applied to estimate the energy cost associated with model tuning. The grid search was exhaustive, considering values between the minimum and maximum of max_depth and n_estimators, with stratified cross-validation in three partitions. For random forest, XGBoost, and LightGBM models, the randomized search technique was applied with 50 iterations, due to the computational cost of exhaustive grid search. All runs utilized all available CPU cores (n_jobs = -1) and a random_state of 42 for reproducibility.

The predictive performance of the models was evaluated by the balanced accuracy on the test base, a suitable metric for the class imbalance scenario. Energy consumption and carbon dioxide emissions were estimated by the CodeCarbon library. Each experimental configuration was executed three times, and the average of the results was used to reduce the influence of random operating system variations. The coefficient of variation was employed to evaluate the stability of CO2 emission metrics. To integrate performance and environmental cost, an Efficiency Index (IF) was calculated for each run, defined as the ratio between balanced accuracy and the amount of gCO2 emitted.

3. Results and Discussion

The results of experiments with decision tree algorithms revealed an intrinsic relationship between model complexity, data scale, and estimated carbon dioxide emissions. Generally, it was observed that an increase in the structural complexity of the trees and the intensification of the search procedures for optimal hyperparameters resulted in significant increases in CO2 emissions. However, the additional gains in predictive performance were often marginal in several scenarios, indicating the existence of a trade-off between performance and environmental impact, as hypothesized by the study.

When analyzing simple classification tree models, it was observed that increasing the number of observations in the dataset contributed to improvements in balanced accuracy. For example, in experiments with 5,000 observations, the maximum accuracy reached 54.30%, while in the subset of 300,000 observations, this value rose to 80.50%. However, these gains showed diminishing returns as the database grew, while the associated computational cost and, consequently, CO2 emissions, increased at a faster pace.

The variation in the maximum tree depth (max_depth) also proved to be a determining factor. In the set with 300,000 observations, the balanced accuracy increased from approximately 63% to 80.5% when the maximum depth was raised from 10 to 20 levels. This performance improvement was accompanied by a consistent increase in estimated CO2 emissions, which grew from 0.023 gCO2 to 0.037 gCO2 in the same scenario, representing an increase of about 65% in emissions.

The experiments that incorporated exhaustive procedures for searching for optimal hyperparameters, such as “grid search” and cost-complexity pruning, revealed extremely high increases in energy consumption and CO2 emissions, without proportional gains in predictive performance. In the case of “grid search”, even with a dataset of 5,000 observations, energy consumption was three orders of magnitude higher compared to direct model training, and this effect intensified with the increase in data scale.

The exhaustive application of cost-complexity pruning proved to be even more burdensome than “grid search”. For the dataset with 300,000 observations, pruning resulted in an emission of almost 250 gCO2, in contrast to 0.037 gCO2 from the base model without tuning, representing an increase of several orders of magnitude. Despite this significant environmental cost, the gain in balanced accuracy was less than one percentage point. This behavior stems from the fact that the procedure is not limited to training a single tree and applying a direct simplification, but involves the successive evaluation of different subtrees generated from the initial structure, implying multiple training sessions and a significantly higher total computational cost.

These findings indicate that the cost associated with the hyperparameter search and optimization step can largely exceed the cost of training the final model, especially in large-scale scenarios. Furthermore, predictive performance may achieve only marginal improvements. The general pattern of trade-off between performance and computational cost was maintained when the analysis was extended to more complex algorithms, such as random forests, XGBoost, and LightGBM.

The average coefficient of variation of CO2 emissions during the three experimental runs was 5.41%, with a maximum value of 16.63%. This suggests that, although the measurement noise from operating system variations had some effect, it was not the main determinant in the CO2 emission measurements made by the CodeCarbon tool. A notable result was that the simple decision tree showed superior average performance to the random forest, even with an approximately 4.5 times lower CO2 emission index.

This finding challenges the assumption of superiority of ensemble models in all scenarios, as performance depends on hyperparameter configuration and dataset structure. The explanation lies in the combination of limited tree depth with a reduced number of estimators, which restricts the ensemble’s ability to capture complex patterns and may produce less informative partitions than those generated by the individual tree, which uses all available variables in its split.

To integrally evaluate the relationship between performance and environmental cost, an efficiency index (IF) was calculated, defined as the balanced accuracy divided by the amount of carbon dioxide emitted in grams. The analysis of this index revealed a consistent pattern: simpler models executed on smaller bases presented the highest efficiency values. In experiments with classification trees and 5,000 observations, the efficiency indices exceeded 800 units, reflecting the low emission associated with these scenarios.

As the dataset size increased and more complex models were used, the efficiency index tended to decrease. This indicates that additional accuracy gains began to require proportionally larger amounts of energy. This behavior was observed in ensemble algorithms and boosting methods, where increases in the number of estimators or the structural complexity of the trees resulted in increased emissions without equivalent performance gains. This resistance intensifies as the model reaches higher balanced accuracy.

The efficiency index thus allowed to highlight that the configurations that maximize accuracy do not always correspond to the most energy-efficient solutions, reinforcing the existence of a trade-off between predictive performance and computational cost. The algorithms with the highest performance tended to concentrate in the region of lowest efficiency. The individualized analysis of hyperparameters reinforced this interpretation, especially when comparing the average behavior of random forest models without tuning for different numbers of estimators.

The models with 10 and 100 estimators presented a similar average balanced accuracy, suggesting that the `max_depth` variable is more relevant to model quality in the studied dataset. However, the average CO2 emissions revealed an increase of 927% between the two groups, demonstrating that changing a single hyperparameter can require significantly more processing without a significant gain in accuracy. This finding has direct implications for the choice of tuning strategies, as the search via `GridSearchCV()` intensifies this problem in a combinatorial way.

The comparison between hyperparameter searches via `GridSearchCV()` and `RandomizedSearchCV()` in random forest models demonstrated that the number of emissions is expressively lower with `RandomizedSearchCV()`, while the balanced accuracies remained very similar. Although the data contemplate only four levels of sample size, the observed pattern suggests that this behavior may repeat regardless of data volume, reinforcing the importance of more efficient tuning strategies.

The comparison between XGBoost and LightGBM revealed the greater efficiency of the latter algorithm, whose leaf-wise tree splitting approach, rather than level-wise, contributes to a lower computational cost (Ma et al., 2018). In models without tuning, XGBoost presented, on average, 1.27 percentage points more than LightGBM, but with an average carbon dioxide emissions almost 2.8 times higher. With the application of random search, XGBoost achieved a maximum balanced accuracy of 92.10% against 88% for LightGBM, however at a cost of 2.5 times higher emissions.

This difference in efficiency between the two boosting algorithms adds to the pattern identified in the relationship between the size of the dataset and the average CO2 emissions. The growth in emissions followed the increase in data volume in an approximately linear manner within the analyzed range. Although this interpretation should be made with caution as it is based on only four sample points, the observed trend reinforces that decisions involving both the choice of algorithm and the scale of the data jointly influence the environmental cost of training machine learning models.

In summary, the experiments confirmed the hypothesis of a trade-off between predictive performance and environmental impact, showing that increasing model structural complexity, expanding data scale, and exhaustively searching for optimal hyperparameters considerably increase CO2 emissions. Accuracy gains, in turn, showed diminishing returns, suggesting that computational efficiency and sustainability should be additional criteria in the evaluation and development of machine learning models.

4. Conclusion

This study aimed to compare CO2 emission estimates and predictive performance between decision tree algorithms in a classification problem, investigating the existence of a trade-off between performance and environmental impact. It was found that increasing the structural complexity of the models, expanding the data scale, and exhaustively searching for optimal hyperparameters consistently increased carbon dioxide emissions. However, the additional gains in predictive accuracy were often marginal, confirming the hypothesis of a trade-off. It was observed that hyperparameter tuning procedures, such as “grid search” and cost-complexity pruning, resulted in significant increases in energy consumption without proportional performance improvements. Among the evaluated algorithms, LightGBM demonstrated a favorable balance between accuracy and emissions, while XGBoost achieved the highest predictive performance with a higher average energy cost. The main contribution lies in the empirical evidence that computational sustainability, measured by CO2 emissions, should be an additional criterion in the evaluation and development of machine learning models, promoting a perspective of efficiency that transcends mere accuracy.

Despite the findings, this study has limitations. The use of a single dataset, even with sample variations, restricts the generalization of the results, as the behavior of algorithms can be influenced by the specific characteristics of the data. Furthermore, emission measurements were performed by the CodeCarbon library, whose accuracy is subject to limitations inherent in indirect monitoring of energy consumption. For future studies, it is suggested to replicate the experiments on datasets with distinct characteristics and extend the analysis to other types of problems, such as image and natural language processing. It is also recommended to investigate whether the identified patterns hold in different computational architectures and energy matrices, deepening the understanding of artificial intelligence sustainability.

Bibliographic References

García-Martín, E.; Rodrigues, C. F.; Riley, G.; Grahn, H. 2019. Estimation of energy consumption in machine learning. Journal of Parallel and Distributed Computing 134: 75-88.

Georgescu-Roegen, N. 1971. The Entropy Law and The Economic Process. Harvard University Press, Cambridge, MA, EUA.

Patterson, D.; Gonzalez, J.; Le, Q.; Liang, C.; Munguia, L.M.; Rothchild, D.; So, D.; Texier, M.; Dean, D. 2021. Carbon emissions and large neural network training. Disponível em: <https://arxiv.org/abs/2104.10350>. Acesso em 12 out. 20

Silva, G. L. O.; Silva, G. 2025. Emissões de gases do efeito estufa: explorando os fundamentos da sustentabilidade e os principais compromissos globais. Revista Jurídica do Ministério Público do Estado de Rondônia 1(1): 158-182.

Strubell, E.; Ganesh, A.; McCallum, A. 2019. Energy and policy considerations for deep learning in NLP. In: 57th Annual Meeting of the Association for Computational Linguistics, 2019, Florence, Itália. Anais… p. 3645-3650.

Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq

To learn more about the course, click here and access the MBX Academy platform

You may also like

Economy, Investments And Banking

October 23, 2026

Financial Education, Behaviors and Biases in Financial Decision Making

Personal financial management represents a growing challenge, influenced by cognitive biases that affect decision-making, even in individuals with high knowledge. The present study analyzed the relationship between the level of financial education and the occurrence of behavioral biases in the financial decision-making of adults residing in Brazil. An applied, quantitative, and descriptive-correlational field survey was conducted by administering a structured questionnaire to 163 respondents. The instrument included sociodemographic variables, financial knowledge and habits, and hypothetical situations to identify cognitive biases. The results indicated that higher levels of financial education were associated with better financial control, saving, and investment practices, with significant correlations with income and schooling. However, the presence of behavioral biases (anchoring, loss aversion, scarcity, optimism/negativity, present bias, status quo, overconfidence, and mental accounting) persisted even among individuals with higher schooling and income, with no statistically significant association with the analyzed sociodemographic variables. It was concluded that financial education, although essential for financial organization and control, was not sufficient to neutralize the influence of cognitive biases. The incorporation of behavioral approaches into financial education programs is suggested.

Keywords: Financial behavior; Behavioral economics; Personal finance; Cognitive heuristics; Cognitive biases.

October 22, 2026

Consumer Journey in the Decision to Purchase Infoproducts in the Digital Environment

The expansion of e-commerce and technological transformation have driven the need to understand consumer behavior regarding infoproducts, whose perceived experience has become crucial for professional development. The study aimed to analyze the factors that influenced the purchase decision of infoproducts in the digital environment, considering the stages of the consumer journey. An applied, quantitative, and descriptive research was conducted through a field survey with 100 consumers from Serra Gaúcha. Data collection occurred via a structured questionnaire, using non-probabilistic sampling. The results revealed a qualified audience with strong “mobile-first” behavior. It was found that the availability of detailed information and social approval were the main attraction triggers in the pre-purchase phase. In the transactional and subsequent stages, the minimization of operational friction, the agility of immediate access, and system security proved crucial for conversion and satisfaction, although gaps in human support efficiency were identified. Retention was based on the trust generated by positive past experiences, overcoming the price factor. It was concluded that the infoproduct consumer journey operates as an integrated system, requiring alignment between technological infrastructure, content curation, and support humanization to ensure engagement.

Keywords: E-commerce; Consumer behavior; Consumer experience; Loyalty; Virtual business.

October 22, 2026

Forecast of Aggregate Default in the Brazilian Financial System by Sarimax Model with Macroeconomic Variables

Aggregate non-payment in the Brazilian financial system is a crucial indicator of credit risk, the prediction of which is regulated by CMN Resolutions n.° 4.557/2017 and 4.966/2021 for the prospective measurement of expected losses. Aggregate non-payment was modeled and predicted using the SARIMAX model, projecting its trajectory until December 2026 under optimistic, base, and pessimistic scenarios. 164 monthly observations (July/2012 to February/2026) and macroeconomic variables such as unemployment, Selic, IPCA, IBC-Br, and household debt were used. The specification with contemporaneous variables was selected based on information criteria and coefficient stability, and residual diagnostics confirmed statistical adequacy, with a MAPE of 3.12%. Historical non-payment ranged between 4.33% and 7.64%. The estimation identified unemployment (β = 0.2534; p < 0.001) and Selic (β = 0.2128; p < 0.001) as the main positive determinants, with strong temporal persistence (AR(1) = 0.8965). Selic showed increasing correlation with non-payment (r = 0.62 at lag 12), while unemployment demonstrated a contemporaneous effect (r = 0.33). Projections indicated non-payment between 6.30% and 7.98% in December 2026, with a range of 1.68 percentage points, highlighting direct implications for provisioning in financial institutions.

Keywords: Unemployment; Predictive modeling; Monetary policy; Loss provisioning; Time series.