# A Machine Learning Approach for the Classification of Refrigerant Gases
## 5 Evaluation  
In this section, we present a comprehensive analysis of the outcomes achieved by the models we trained. Through the implementation of a stratified holdout methodology, the dataset underwent a meticulous partitioning procedure, leading to the creation of two distinct subsets, designated as the Train and Test sets.  
Before presenting the evaluation measure we first must describe the True Positives (TP), False Positives (FP), True Negatives (TN), and False Negatives (FN) measures for the multiclass classification problem.  
True Positives (TP): TP represents the fraction of instances correctly classified as belonging to a specific class among all instances that actually belong to that class. In a multi-class problem.  
True Negatives (TN): TN represents the fraction of instances correctly classified as not belonging to a specific class among all instances that do not belong to that class.  
False Positives (FP): FP represents the fraction of instances incorrectly classified as belonging to a specific class among all instances that do not belong to that class.  
False Negatives (FN): Description: FN represents the fraction of instances incorrectly classified as not belonging to a specific class among all instances that actually belong to that class. In a multi-class problem, FN is computed for each class, signifying instances that were erroneously excluded from that class.  
These definitions ensure that the assessment of model performance in a multi-class setting accounts for the nuances of each class separately, allowing for a more detailed and informative evaluation.  
Accuracy: Accuracy represents the fraction of correctly classified instances out of the total number of instances in the dataset.  
\[Acc=\frac{TP+TN}{TP+TN+FP+FN} \tag{1}\]  
Precision: Precision quantifies the fraction of true positive predictions among all instances predicted as positive.  
\[P=\frac{TP}{TP+FP} \tag{2}\]  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & \multicolumn{6}{c}{**Number of Signals**} \\ \hline
**Dilution with Air** & 0\% & 5\% & 10\% & 25\% & 50\% & 70\% \\ \hline
**R32** & 20 & 20 & 20 & 20 & 20 & 20 \\
**R134a** & 20 & 20 & 20 & 20 & 20 & 20 \\ \hline \end{tabular}
\end{table}
Table 2: Distribution of collected signals with the two refrigerant gases, R134a and R32 with different air dilution levels.  
Recall: Recall, also known as Sensitivity or True Positive Rate, represents the fraction of true positive predictions among all actual positive instances.  
\[R=\frac{TP}{TP+FN} \tag{3}\]  
F1 Score: The F1 Score is the harmonic mean of precision and recall. It provides a balance between precision and recall, making it useful when dealing with imbalanced datasets.  
\[F1=\frac{2\cdot P\cdot R}{P+R} \tag{4}\]  
We conducted two experiments. In the first experiment, our aim was to differentiate between gases R32 and R134a (2 class classification problem), and in the second one we tried to differentiate between R32, R134a, and dilution level (12 class classification problem). The first experiment is Gas type Classification and the second one is Gas Type and dilution level Classification. Finally, we employed a stratified holdout technique [37], the dataset was divided into two distinct subsets--train (80%) and test--aiming (20%) to evaluate the efficiency of machine learning algorithms. This method guaranteed that the distribution of each gas class remained consistent across both training and testing sets, thereby minimizing the potential for biased performance evaluations. Moreover, this approach allows for the utilization of multiple performance metrics.