# A Machine Learning Approach for the Classification of Refrigerant Gases
## 3 Materials and Methods
### Random Forest Classifier  
Supervised classification, a prominent branch of machine learning, involves training algorithms on labeled data to enable them to recognize patterns and make predictions on unseen samples [28; 29]. In this section, we present a comprehensive evaluation of the Random Forests algorithm [30; 31].  
We opted for Random Forests for several compelling reasons. First and foremost, Random Forests demonstrated superior performance in terms of predictive accuracy across various datasets, making them a robust choice for our classification task [31]. Furthermore, Random Forests' ensemble nature and feature randomness mitigate the risk of overfitting, providing better generalization capabilities compared to some other algorithms, such as Multi Layer Perceptron (MLP) [32], which are more prone to overfitting, especially with complex datasets [33].  
Moreover, the interpretability of Random Forests stood out as a crucial advantage over black-box models like MLP and Support Vector Machines (SVMs) [34]. The ability to easily estimate feature importance allowed us to gain valuable insights into the significant variables driving the classification decisions, making the results more interpretable and insightful. Lastly, Random Forests are computationally efficient, especially when compared to complex models like SVM and MLP, which often require extensive computational resources and training time. Given our research constraints, the efficiency of Random Forests made them a practical and viable choice for our classification task.  
The algorithm can be summarized in a few key steps. Firstly, a random subset of the training data is selected with replacement, known as bootstrapping [35]. This step introduces diversity among the individual decision trees that will be generated, reducing the risk of overfitting [36]. Next, decision trees are constructed using these bootstrappeddatasets, but with a slight variation. At each node of the tree, instead of considering all available features for splitting, a random subset of features is chosen. This process, called feature bagging or random feature selection, helps reduce the correlation between trees and further improves model generalization. Once the decision trees are fully grown, they are used to make predictions on new data points. For classification tasks, the final prediction is often determined by a majority vote among the individual trees, while for regression tasks, it is typically the average of the predictions.  
In summary, the Random Forests algorithm combines the strength of bootstrapping, random feature selection, and ensemble techniques to create a robust and accurate predictive model, making it a valuable tool in various scientific and practical applications. In our analysis, the Random Forest model was configured with 300 trees, which provided a robust ensemble for handling the variability in our dataset while balancing computational efficiency. Additionally, we set the maximum depth of each tree in the forest to 5. These parameters were selected based on a series of preliminary tests that evaluated the model's performance with varying numbers of trees and depths.