## 4 ML Techniques
### Classification Performance Assessment  
Assessing if the ML model is working as intended or not is often performed by dividing the data into training, validating, and testing data. For example, a common issue when training supervised learning models, overfitting, occurs when a model is developed to fit the training dataset too closely and cannot make accurate predictions for new data. Two of the most common methods for avoiding overfitting in ML are the hold-out and k-fold cross-validation methods [12]. These split the data available into training and testing subsets to validate the model's prediction accuracy with data otherwise unknown to the model.  
The hold-out method involves partitioning the dataset into a testing and training set. As the name suggests, the training set is used to train the ML model, where the testing set is used to validate its performance. The ratio of training versus testing data is usually 7:3. One limitation of this method is that the number of data samples available for testing is reduced, and the potential for an imbalance in data representation is also increased. The k-fold cross-validation method is similar to the hold-out method, where the dataset is partitioned into several subsets. With each iteration, one subset is used for testing, with the others used for training the model. This process is repeated until each subset has been left out once for testing and is visualized in Figure 14. The k-fold method's main advantage over the hold-out method is that the model can use all the available data for both training and testing.  
The most common metrics by which the performance of any ML classifier is often assessed are precision, recall, and F1 score (or accuracy) [116]. Precision is defined as the ratio of true instances within a predicted class to the total number of instances predicted.  
\[\text{Precision}=\frac{\text{True Instances}}{\text{Predicted Instances}} \tag{2}\]  
Figure 13: Reinforced learning model-based framework for layerwise monitoring and optimization of L-PBF processes proposed by [PERSON] et al. [115].  
In contrast, recall is the ratio of correct predictions of a specific class to the total number of instances in that class.  
\[\text{Recall}=\frac{\text{True Instances}}{\text{Total Instances}} \tag{3}\]  
The F1 score represents the model's overall performance and is defined as the harmonic mean of the precision and recall, where a score of 1 implies perfect performance.  
\[\text{F1}=2\frac{\text{Precision}\cdot\text{Recall}}{\text{Precision}+\text{ Recall}} \tag{4}\]  
The alternative to precision calculating is accuracy, defined as the ratio of correct predictions overall predictions. However, it should be noted that this may not be a viable metric when the number of samples from each class is unbalanced.  
It is hard to suggest a learning approach that is superior to another when applying ML algorithms for L-PBF monitoring applications. On the one hand, supervised learning approaches are well suited when a huge amount of data is collected (which is the case in online monitoring) and proved efficient in learning accuracy and classifying monitored defects. On the other hand, unsupervised learning has the clear advantage of not labeling the data, thus saving the need for ex situ experiments. More research is required to investigate if semisupervised ML algorithms can be useful for the online monitoring of L-PBF processes. The semisupervised ML techniques could have the advantages of high classification accuracy and reducing the need to label all data. It is also important to understand which learning technique is suitable for which sensor is being used. The following section reviews the different ML algorithms used with different sensors to help answer the question of which ML algorithm is more suitable for monitoring L-PBF processes.