In recent decades, Multiple Input Multiple Output beamforming is deliberated as the vital technology enablers for 5G mobile radio services. Since, it provides noticeable improvement regarding throughput and coverage measures in 5G networks. Primarily, executed 3D MIMO beamforming using the modified Support Vector Machine algorithm which forms beam effectually to the users. The interference is mitigated in two stages that are small cell interference and macro cell interference by measuring the interference power from the cells. To provide better security to the data transmitted over Device-to-Device communication, Advanced Encryption Standard algorithm is used. The results attained from the simulations are auspicious in terms of metrics including throughput, Signal to Interference plus Noise Ratio (SINR) and Signal to Noise Ratio (SNR). From the simulation results, we prove that our ML-3DIM method increases throughput, SINR, SNR by up to 20%, 30% and 35% respectively compared to the existing methods including PABM, ULABM, and NOMA.