# Density Prediction in Powder Bed Fusion Additive Manufacturing: Machine Learning-Based Techniques
## 3 Methodology
### Support Vector Machine  
Support vector machine (SVM) defines the boundary between two different data types. These defined boundaries are used for the classification and complex regression problems [16]. The boundary is technically called a \"hyperplane\". The hyperplane divides the group of similar data by measuring the distance between the parting line and the nearest data point in both groups; such hyperplane is the maximum margin hyperplane, as shown in Figure 6A [57]. The hyperplane shown in Figure 6A is for the linear data set. However, it is not always the case in an actual application as there are complex non-linear relationships between data sets. Figure 5: KNN explanation with k = 3 and k = 6 neighbors (blue, green, and red show distribution of class of data). The SVM algorithm involves two more parameters to solve any complex interrelationship: cost function and kernel function. Cost function (C) allows some data points to classify into an opposite group of data. Cost function plays an important role when the data points are not linearly separable. Hence, smooth hyperplane can be obtained with the misclassified data points as shown in Figure 6B [58]. The Cost value decides the hyperplane's smoothness and correctly classified data count [58]. [PERSON] et al. [41] used the SVM algorithm to predict the optimum energy density level for defect-free layer deposition by EB-AM. The cost function of 50 and 100 gives the minimum error rates. The KNN algorithm is beneficial in classifying the defects. The higher value of C increases the risk of over-fitting in the developed model [59]. The kernel function, which converts the non-linear hyperplane into a linear hyperplane with a higher dimensional function, aids in speculating data from a different perspective [59]. The kernel functions are mathematical relationships between datasets to simplify the hyperplane [51]. Several mathematical relationships are used as kernel functions in the SVM model, as shown in Table 2[60]. There is no constructive rule that a particular kernel gives better accuracy; it depends on the data set and their interrelations. The cross-validation and various error terms are used to get the optimum SVM model by trial-and-error approaches [42]. Several pieces of literature reported that the SVM performs better concerning parameter optimization of additive manufacturing. [PERSON] et al. [60] explained the overall idea about the application of the SVM algorithm in additive manufacturing. ML could be implemented in various areas such as parameter prediction, defect detection, printing fault reorganization, and process map development. SVM can be used for classification as well for regression. [PERSON] et al. [61] showed that SVM works accurately to forecast electrical energy consumption with the help of past datasets. [PERSON] et al. [62] also compared the SVM for quality prediction model of honing process concerning neural networks, logical \begin{table}
\begin{tabular}{c c} \hline
**Classifier** & **Kernel Function** \\ \hline Linear & K (\(\chi_{i},\chi_{j}\)) \(=(\chi^{\mathrm{T}}\chi_{i})\) \(\rho\) \\ Gaussian RBF & K (\(\chi_{i},\chi_{j}\)) \(=\exp\left(-[[\mathrm{IN}_{i}-\chi_{i}\mathrm{H}^{2}]/2\sigma^{2}\right)\) \\ Sigmoid & K (\(\chi_{i},\chi_{j}\)) \(=\tanh\left(\alpha\ (\chi_{i}\times\chi_{i})+\
u\right)\) \\ Dirichlet & K (\(\chi_{i},\chi_{j}\)) \(=\sin\left(\mathrm{m}+1/2\right)\ (\chi_{i}-\chi_{j})/2\sin\left((\chi_{i}-\chi_{j})/2\right)\) \\ Multilayer perceptron & K (\(\chi_{i},\chi_{j}\)) \(=\tanh\left(\chi^{\mathrm{T}}\chi_{i}+\mu\right)\) \\ Complete polynomial of degree & p K (\(\chi_{i},\chi_{j}\)) \(=(\chi^{\mathrm{T}}\chi_{j}+1)\) \(\rho\) \\ \hline \end{tabular}
\end{table} 
Table 2: SVM kernel classification. Figure 6: (**A**) 2-D SVM model and (**B**) SVM cost function. regression, and decision trees. [PERSON] et al. [6] mentioned the application of SVM in different additive manufacturing domains as regression and classification to predict the defects, melt pool analysis, and parameter optimization.