# Improving Automated Machine-Learning Systems through Green AI
## 5 Results
### Experiment I  
In this experiment, as a first case, the performance of different classification models was evaluated using the Bayesian method to optimize hyperparameters with energy efficiency in mind. The performance metrics evaluated were CO\({}_{2}\)e, accuracy, balanced accuracy, F1-score, and energy consumption (see Table 2). The results indicate that the model with the lowest CO\({}_{2}\)e was the DecisionTreeClassifier (DTC), with 0.0001 CO\({}_{2}\)e, but it had moderate accuracy and F1-score. The models with the highest accuracy were GaussianNB (GNB, greater than 0.93) and RandomForestClassifier (RFC, greater than 0.94). However, their CO\({}_{2}\)e was high (greater than 0.014). In balanced accuracy, GNB, RFC, and GradientBoostingClassifier (GBC) stood out, with values above 0.93. The F1-score measures precision/recall and is crucial in classification models. GNB, RFC, and GBC achieved the highest scores (greater than 0.94). Energy consumption (energy train) was low in simple models like DTC and GNB (less than 2) but high in ensemble methods like RFC (greater than 40). In test energy consumption (energy test), ensemble methods also required significant processing power (greater than 120). There is a trade-off between performance metrics and energy consumption/CO\({}_{2}\)e.  
More powerful models consume more. Considering the overall performance of all metrics, the RFC algorithm achieves a good balance between precision (0.94 accuracy, 0.95 F1-score) and reasonable consumption (0.014 CO2e). In this experiment, as a second case, the performance of different classification models was evaluated using the random method to optimize hyperparameters with energy efficiency in mind. The most efficient algorithms in terms of CO2e emissions were LSVC, DTC, and GNB, with values below 0.001. In terms of performance metrics such as accuracy and F1-score, the top-performing models were SVC, GBC, and RFC, with values above 0.93 and 0.94, respectively. However, these latter models also exhibited high energy consumption and CO2e emissions due to their complexity. Decision Trees, Linear SVM, and Naive Bayes required minimal processing, making them \"green\" models. The trade-off between model accuracy and energy efficiency/emissions is evident. In conclusion, SVC, GBC, and RFC achieved the highest accuracy but with a significant environmental impact. Optimization or the use of \"green\" models like Decision Trees or Naive Bayes would be necessary to reduce energy consumption and emissions. In Experiment I, the Bayesian and random methods were compared for AutoML optimization. The results showed that the best models in terms of accuracy, balanced accuracy, and F1 score were GBC, RFC, and SVC. All these models achieved values exceeding 0.93 for  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Energy** & \multirow{2}{*}{**Accuracy**} & **Balanced** & **F1** & **Energy** & **CO2e** \\  & **Train** & & **Accuracy** & **Score** & **Test** & **(g/Kwh)** \\ \hline DTC & 0.3458 & 0.9202 & 0.9220 & 0.9363 & 1.4758 & 0.0001 \\ DTC & 0.5368 & 0.9363 & 0.9277 & 0.9508 & 1.9767 & 0.0002 \\ DTC & 0.9428 & 0.9202 & 0.9220 & 0.9363 & 1.7607 & 0.0002 \\ GNB & 0.5214 & 0.9358 & 0.9270 & 0.9506 & 2.2305 & 0.0002 \\ GNB & 0.9199 & 0.9358 & 0.9270 & 0.9506 & 1.9052  
accuracy and F1-score. Training times were comparable between the two groups for models such as Gradient Boosting (70-90 s) and Random Forest (40-60 s). Energy consumption during testing was also similar between Bayes and random for the main models, with values ranging from 100 to 200 watts. Consequently, the CO\({}_{2}\)e values were very close in both groups for the top models, ranging from 0.01 to 0.03 kilograms of CO\({}_{2}\) equivalent. Decision Trees and linear SVC were \"green\" in both cases, exhibiting low consumption and CO\({}_{2}\)e. Bayes slightly improved the hyperparameters for Gradient Boosting (precision of 0.9309 compared to 0.9256). However, overall, the results were quite similar.