An optimized active pre-chamber geometry was obtained by combining computational fluid dynamics (CFD) and machine learning (ML). A heavy-duty engine operating with methane under lean conditions was considered. The combustion process was modeled with a multi-zone well-stirred reactor (MZ-WSR) with a skeletal methane oxidation mechanism. The simulations were run for a complete cycle. For the optimization study, the pre-chamber was parametrized; six independent and three dependent variables were considered, while the volume was kept constant. Three hundred pre-chamber designs were generated, and a one-shot design of experiments (DoE) optimization was first considered. A merit function was adopted to rank the designs, and an optimum design was found from the DoE results, which yielded considerable improvements in merit ranking, considering fuel consumption, engine-out emissions, noise, and safety; secondly, machine learning algorithms were trained by utilizing the DoE results aiming at finding a globally optimum geometry for the considered operating condition. Five sequential iterations were performed, and the ML algorithms were capable of proposing a new design with superior performance compared to the best DoE.