###### Abstract  
In this work, Laser Powder Bed Fusion (LPBF), an additive manufacturing (AM) process, was optimised to produce pure magnesium components. The focus of the presented work is on the prediction of the relative product density using the machine learning model XGBoost to improve the production process and thus the usability of the material for practical use. Experimental tests with different parameters, laser power, scanning speed and layer thickness, and fixed parameters, track overlapping and hatching distance, were analysed and resulted in relative material densities between 89.29% and 99.975%. The XGBoost model showed high predictive power, achieving an R\({}^{2}\) test result of 0.835, a mean absolute error (MAE) of 0.728 and a root mean square error (RMSE) of 0.982. Feature importance analysis showed that the interaction of laser power and scanning speed had the largest influence on the predictions at 35.9%, followed by laser power \(\times\) layer thickness at 29.0%. The individual contributions were laser power (11.8%), scanning speed (10.7%), scanning speed \(\times\) layer thickness (9.0%) and layer thickness (3.6%). These results provide a data-based method for LPBF parameter settings that improve manufacturing efficiency and component performance in the aerospace, automotive and biomedical industries and identify optimal parameter regions for a high density, serving as a pre-optimisation stage. additive manufacturing; machine learning; XGBoost; magnesium; relative density +
Footnote †: journal: applied sciences  
Article  
[PERSON], K and mechanical integrity of the manufactured parts, although progress in addressing these problems has been made [10; 11]. Achieving high density is crucial to ensure the performance and reliability of the produced parts in certain applications, especially in load-bearing biomedical implants [3] where mechanical strength is critical. In study [12], the authors investigated stochastic pure Mg foam using LPBF. The results of the study showed that when the volumetric energy density was increased from 20 to 40 J mm\({}^{-3}\), the porosity of the product decreased from 42.7% to 40.5% while its compressive strength increased from 37 MPa to 46 MPa, demonstrating the importance of product density in determining mechanical properties, with lower porosity correlating with higher strength. It is well established that product density plays a major role in the resulting mechanical properties, making density optimisation a priority when working with LPBF made of Mg. The effects of changing parameters such as laser power, scanning speed, track overlap, hatch spacing and layer thickness have a direct and proven influence on the product [13; 14]. Traditional approaches to LPBF process parameter optimisation with the aim of achieving high density involve extensive and iterative experimental trials, which are both time and resource intensive. However, due to the complex relationships between these parameters, e.g., the trade-off between laser power and scanning speed, which influences the energy density, it can be difficult to determine the optimal settings using only traditional approaches. The systematic approach in [15], where the authors optimised the parameters for the LPBF process of low-alloy steel, has shown that the optimisation of the process parameters is necessary to avoid defects such as a lack of fusion and keyholing [16; 17; 18]. This methodology can also be applicable to Mg given the similarity in process challenges and has been applied to Mg alloys [19]. Machine learning (ML) methods have provided viable solutions by developing predictive models that can efficiently represent the complex relationships between process parameters and part properties, which have reduced the need for extensive experimentation [20; 21; 22]. In this research, XGBoost [23], a known gradient boosting framework, was selected due to its proven efficiency in handling regression tasks with structured data.