In the oil and gas industry, the fluctuations of semiconductor component delivery time significantly impact Printed Circuit Board Assembly (PCBA) production planning. The discrepancies between the supplier quoted lead time and actual delivery lead time present a substantial challenge, as the sponsor company`s MRP system lacks a robust safety stock model to mitigate component shortage. To enhance the predictability of the delivery lead time and the standard deviation of lead time, this project introduces a machine learning-based framework. To mitigate semiconductor components shortage, this project also introduces a dynamic safety stock model, which incorporates the predicted delivery lead time and standard deviation of lead time. Through a comparative analysis of model performance, the tree model emerged as the most effective in predicating delivery lead time. The dynamic safety stock model also demonstrated improvements in inventory management and production planning. These improvements significantly reduce the risk associated with semiconductor supply chain variability and strengthen the company`s operation resilience.