# Density Prediction in Powder Bed Fusion Additive Manufacturing: Machine Learning-Based Techniques
## 5 Discussion  
The R-squared value of predicted vs. actual density of dataset for each ML model is compared in the earlier section, as shown in Figure 13. This section compares the prediction error for different ML techniques with the RMSE, MAE, and MAD, as shown in Figure 14.  
Figure 12: Linear regression: (**A**) comparison of the actual and predicted density of AM SS316L and (**B**) statistical correlation between actual and predicted values for the applied model. Figure 13: R-squared comparison for the different ML model. In the present study, the most suitable ML model for density prediction in the PBF process is SVM compared to the other three techniques, i.e., LR, ANN, and KNN. The linear regression always tries to fit the parameters in a straight line. However, this is not necessary in all cases. Therefore, the R-squared value for LR is lesser than the ANN and SVM models. The linear regression prediction on the test dataset also shows a significant variation with the actual data, which can be observed with the RMSE, MAE, and MAD values. The overall error rate for LR is found to be higher than the SVM and KNN models. [PERSON] et al. [25] also used different ML techniques to perform a density prediction model for the flash sintering process. They observed that SVM performs better compared to ANN, KNN, and random forest ML techniques, which is in line with the results obtained in the present study. [PERSON] et al. [26] also performed physics-based ML techniques to predict the porosity of the building part. The developed ML model showed good performance with a minimum error rate of 10 to 25%. [PERSON] et al. [27] also developed an ML model with a random forest technique to predict the density of build parts under different environmental conditions. [PERSON] et al. [65] performed a similar approach with conventional techniques. They utilized dimensionless numbers for density prediction for various metal powder-based additive manufacturing materials. The KNN model is performed well with a minimum RMSE value of 1.83. KNN is the only model that works with one parameter, i.e., the numbers of neighbors. However, the KNN model cannot find the unique relationships between the features. The KNN model has less R-squared value compared to SVM and ANN models. The KNN algorithm does not develop the model or learn the interrelationship between the parameters. The KNN works better for classification problems or regression with the minimum number of parameters. Hence, gives a less error rate. However, based on the results from this study, it is not advisable to implement it for the prediction of the parameter in the PBF process. ANN and SVM are the most suitable ML models for density prediction in the PBF process. The SVM is also sometimes referred to as a shallow type of neural network model. Generally, the ANN model outperforms many training datasets. However, with the given data set, both ANN and SVM models performed well in predicting the results. A single  
Figure 14: RMSE, MAE, and MAD error comparison for different ML models. ANN can be trained to solve hand-written digits problem while 10 SVMs (one for each digit) are required. In the ANN model, there are more parameters to control, such as input nodes, numbers of hidden layers, model structure, activation function, epochs, etc., making the model complex to handle. However, it is said to be the best ML model extensively used for prediction. The main limitation of the ANN model is over-fitting issues, as explained in the earlier section. ANN models are more prone to being trapped in the local minima to predict a value and miss the global picture. ANN is a flexible and complex algorithm. It dynamically picks the best regression model, i.e., linear, logistic, or polynomial. The accuracy of an ANN model is higher than other models because their arsenals in the hidden layer boost accuracy by over-fitting towards the training dataset. The R-squared value with the ANN model is found to be 0.95, which is the highest among them.