Cybersecurity is becoming a critical issue with the increasing reliance on digital systems that are vulnerable to attacks. Proactive cyberattack prediction is one of the main approaches in early detection systems, where machine learning plays a strategic role. This research compares two popular machine learning algorithms, namely Bayesian Network and Support Vector Machine (SVM), to determine the most effective algorithm in predicting cyberattacks. This research uses two benchmark datasets, namely UNSW-NB15 and KDD99, as well as real attack data from Elazığ, Turkey. The analysis shows that the Bayesian Network implemented through the MCVAE_PBNN approach achieves up to 96% accuracy on the UNSW-NB15 dataset, with the advantage of detecting distributed and uncertain attacks. On the other hand, the SVM linear (SVML) algorithm showed a prediction accuracy of 95.02% in attack method classification, excelling in the case of data with clearly defined features. This study also analyzes the advantages and limitations of both algorithms, and provides implementation recommendations based on the needs of the detection system. The findings reinforce the urgency of developing adaptive predictive models in modern cybersecurity.