Breast cancer is one of the most common types of cancer and is the second main cause of cancer death in females. Early detection of breast cancer is crucial for the survival of a patient as well as for the quality of life throughout cancer treatment. The aim of this study is to develop improved machine learning models for early diagnosis of breast cancer with high accuracy. In this context, a performance comparison of machine learning algorithms including Support Vector Machines, Decision Trees, Naive Bayes, K-Nearest Neighbor, and Ensemble Classifiers was performed on a dataset consisting of routine blood analysis combined with anthropometric measurements to diagnose breast cancer. Neighborhood component analysis was applied as a feature selection method to reveal relevant biomarkers that can be used in breast cancer prediction. In order to assess the performance of each proposed classifier model, two different data division procedures such as hold-out and 10-fold cross-validation were employed. Bayesian Optimization algorithm was applied to all classifiers for the maximizing the prediction accuracy. Different performance criteria such as accuracy, precision, sensitivity, specificity, and Fmeasure were used to measure the success of each classifier. Experimental results showed that the Bayesian optimization-based K-Nearest Neighbor performs better than other machine learning algorithms under the hold-out data division protocol with an accuracy of 95.833%. The results obtained in this study may provide a new perspective on the application of improved machine learning techniques for the early detection of breast cancer.