In this article, a 5G compact millimeter-wave dipole antenna with high gain and its array filter-antenna is proposed, following a theoretical discussion is proposed. To increase the gain and focused mainbeam, the double dipole is inserted at the ground plane. The results show that the proposed antenna has an impedance band-width (IBW) of around 7.14% and 6.7 dBi gain at 28 GHz. Next, a 5G filter is proposed with 4% IBW and lower than 0.6 dB gain insertion loss. A simple phase-shifter with 2-bit structure is designed in an 8-elemens array filter-antenna with 0.35λ spacing between the two elements which uses a meander-line to reduce mutual-coupling. First, the phased-array filtenna (filter-antenna) is fabricated to meet the analog beamforming challenge. The IBWs of the array filter antenna are approximately 3.5% with a high gain of 15 dBi. Second, a novel machine learning method is proposed as an alternating direction method of multipliers and Bayesian Optimization (ADMM-BO) is used in the hybrid beamforming for such partiallyconnected phased-array structures. Simulation and measurement results show that the proposed antenna and its array have a high gain in analog and hybrid beamforming and acceptable data rates. The data-rates of this array reach 100 Mb/s in SNRs higher than 10 dB. The amount for 0 dB SNR is 75 Mb/s. These results also indicate that the mainbeam shift is in the range of [−50 • , 50 • ] with a gain in variations of around 1.5 dB and side lobe level (SLL) of about −10 dB at 50 • .INDEX TERMS Microstrip patched antenna, 5G communication, mmwave filter, phase shifter, phased array filter-antenna, analog and hybrid beamforming, ADMM-BO.