In this paper, a substrate integrated waveguide (SIW) endfire antenna array with zero clearance is proposed for 5th generation (5G) mobile applications using machine learning-assisted optimization. In particular, a novel impedance matching architecture that involves three arbitrary pad-loading metallic vias is investigated and adopted for the antenna element. Due to the stringent design requirements, the locations and sizes of the vias and pads are obtained via a state-of-the-art machine learning assisted antenna design exploration method, parallel surrogate model-assisted hybrid differential evolution for antenna synthesis (PSADEA). Keeping a very low profile, the array optimized by PSADEA covers an operating frequency bandwidth from 36 GHz to 40 GHz. The in-band total efficiency is generally better than 60% and the peak gain is above 5 dBi. The beam scanning range at 39 GHz covers from -20 to 35 degree .