1. Introduction
Cancer cells are of two types (benign or malignant). In general, cells are of ability to divide and disseminate different body parts and lead to novel tumors. Which are also considered the second main cause of the rise in deaths among females, which has a greater impact on women than on men. There are several causes of breast cancer, including: It might undoubtedly be heritable (i.e. a family member or close relative is affected), aging (since infection increases over time), postmenopausal obesity or gaining weight, alcohol or smoking, or other factors. Early diagnosis and treatment rises the chance of survival from the disease, which raises the probability of survival [1].
Several studies have investigated breast cancer using varying ML algorithms, which classified the type of tumor and predict it, assisting in the treatment of the disease and reducing its prevalence.
In (2017) Murugan et al. used linear regression methods, decision tree and randomizing forest to classify and expect breast cancer tumors on a set of data attained out of the UCI ML Repository (Wisconsin Breast Cancer), the ratting of success for classification was 84.14% Which was taken out of by linear regression and a prediction rate was 88.14% Which was obtained by random forest [2].
In 2019, DT and KNN algorithms were employed for classifying breast cancer kinds by Rajaguru and Sannasi Chakravarthy. The algorithms were used in the Wisconsin diagnostic breast cancer dataset. They used the principal components analysis to select features and compared the methods using a standard performance matrices. They concluded that the KNN classifier performed better than the DT classifier in classification [3].
In 2020, Islam et al. compared several ML algorithms (SVM, K-NN,RF, ANN, and LR) with each other using data taken out of the UCI ML database. The performance comparison was centered upon numerous measures, like (sensitivity, accurateness, specificity, negative predictive value, false negative rates, false positive ,F1 score, precision and Matthews correlation coefficient).The comparison results were as follows: the accurateness, precision and F1 score for the ANN were (98.57%, 97.82%, and 0.9890) while (97.14%, 95.65%, and 0.9777) for SVM, so ANN is the best classifier [4].
In the same year, Assegie employed grid search to discover the optimal hyper parameters and proposed the optimized (KNN) model to obtain accuracy in detecting breast cancer. It was used on data obtained out of the (Wisconsin) breast cancer dataset taken out of (Kaggle). After comparing the performance of the (KNN) with tuned hyper parameters and with default hyper parameters, it was found that the accurateness of the suggested enhanced model was (94.35%) more than the default model, which was (90.10%) in diagnosis [5].
Al-harthi et al. (2021) employ the adjusted variances of the features, which in turn act as weights within the L1_ regularization when regularizing the elastic net model to address the inconsistency problem used regularized logistic regression with an adaptive elastic net RLRAEN. They also applied their proposed method to the Wisconsin breast cancer dataset from the UCI repository, and compared it with other penalized ways. The researchers concluded that the method (RLRAEN) is more efficient [6].
In the same year, Assegie et al provided a model for breast cancer prediction by DT and adaptive boosting (Adaboost) on a breast cancer dataset obtained out of (Kaggle) data which consisted of (569 samples, of which 37.25% were benign tumors and 62.74% were malignant tumors). The DT algorithm showed a bias towards benign observations , the researchers found that adaptive boosting was more accurate than DT, with the percentages reaching (92.53% to 88.80%) [7].
In 2022, Nasser and Behadili used DT and KNN algorithms, with feature selection, in DT where the (Gini index) provided accurateness of (87.83%) while with (entropy) the accuracy was (86.77%) in these cases age showed greater effectiveness especially when the age is less than 45.5 while (ki67) appeared the second in effective. KNN was with a rate of 86.24% of accuracy. in the end, the researchers concluded that stage II breast cancer was the most common [8].
In 2023, Bokhare and Jha compared and evaluated ML models, like (KNN, DT, SVM, RF, SVM Kernels, LR , and Naive Bays models) using the accuracy criterion, and concluded that the DT classifier was the most accurate, reaching (97.08%) more than others [9].
In 2024, Ahmed et al compared machine learning algorithms, including (KNN, RF, DT, (CART), SVM and naïve bayes) for diagnosing breast cancer type as well as early prediction of the disease. After analysis, it was concluded that the SVM algorithm outclassed further algorithms for accuracy, data utilization, and precision (Ahmed et al., 2024).
In 2025, Alwazy et al. used statistical learning and machine learning algorithms to diagnose and classify breast, heart, prostate and lung diseases. The algorithms (SVC, RF, DT, XGBoost, ridge and elastic net and lasso) were used on four medical datasets. The researchers compared the algorithms with each other and evaluated the performance based on the measures of accuracy, precision, f1 score, recall and area under the curve. They reached the SVC and RF algorithms that had a maximal accurateness of up to 98% and a score under the curve of 1 in distinguishing between malignant and benign breast cancer samples [11].
The aim of this search is to classify and predict breast cancer tumors by algorithms logistic regression, elastic net, decision tree, random forest, naïve bays and k- nearest neighbor.
This paper divided in 4 section, first included introducing part and reviewing literatures for breast cancer, 2nd section include used methodology, the 3rd presents collecting data and findings and discussion and lastly was the conclusion in the 4th section.
2. Materials and Methods 2.1 Logistic Regression (LR):
Logistic regression (LR) model which also called the logit model, studies the relationship among a definite dependent and many independent variables, which might be continuous, discrete, or qualitative data. If the dependent variable has only two values, then it called binary logistic regression model. And if it is of more than two values, then it is called a multinomial logistic regression model. The logistic regression model is:
where p points out the event probability, xi are explanatory variables and (b0,b1,..,bi ,i=1,..,n) are the regression coefficients associated with the reference team [12] ,[13].
Equation (1) can be written in another form:
Where ŷi indicates to the estimated continuous chance, e (natural logarithm) and b0 + bx1 + b2x2 + ⋯bxi stands for the equation of linear regression for independent variables represented in the logit scale [14] .
2.2 Elastic Net Logistic:
A logistic model may contain a large number of variables that may be penalized for neglecting the coefficients of non-significant variables or those close to zero, in this case, the model called regularization model. Regularization's process is important in fitting regression models with a greater amount of variables, as this process can produce models with a greater amount of parameters which in turn makes the estimation process difficult when the amount of features is maximal. The most widely used penalized regression includes [15] :
1. Ridge regression: in cases where the contribution of the variables is small and their coefficients are close to 0, the model will take all variables, as it is beneficial to include all variables in the model It can be expressed by the equation:
2. Lasso regression: this model includes the most important variables while the coefficient of the less important variables are equal to 0. It can be expressed by the equation:
So elastic net regression combines lasso and ridge regression.
From equation (3) and (4) ,can be obtained elastic net equation: [16],[15].
2.3 Decision Tree (DT):
DT is commonly employed algorithms in supervised ML and is applicable to both classification and regression. [17]. DT consists of many nodes including the root node which is the structure of the tree. All nodes are connected to each other by edges, except for the root node. each node has one incoming edge. Some nodes, known as internal nodes or test nodes, have one or more outgoing edges. the instance space of each internal node is divided to dual or further subspaces relative to the discrete functions of the input values [8]. The most advantage for DT algorithm is estimation, prediction and classification [9] .
2.4 Random Forest (RF):
It is considered one of the new techniques in machine learning and its principle is the random selection of the feature in the decision tree training process. RF is used to solve classification and prediction problems as well as reduce dimensions and detect abnormal patterns [18],( Ahmed et al., 2022). The basis of the RF algorithm is bagging, which can be considered a special case of it, where the algorithm consists of a set of m tree classifiers denoted as H1(x), H2(x),..., HK(x). In addition to bagging, there is another source for randomness the forest ensemble. A learning algorithm is haphazardly chosen at every node of the tree, and a subset of m features is evaluated. The clustered classifier can then be given the symbol H(x) which refer to the aggregated classifier , Then we can write the classification margin function which specifies the extent whereby the proportion for the accurate class y may exceed the maximum obtained by class c than y as: [20] .
2.5 Boosting:
It is an alternative method for building models. It works on fitting models to a new set of data by taking samples from the original set. we set the residuals at ri=yi and the regression function at f0(x)=0 for all observation. The algorithm then repeats these actions steps for a=1,...,A:
1. A tree model is fitted to the responses r and the features x, then the regression function of this tree is ga.
3. Then calculate the new residuals from ri = ri −λga(xi)
2.6 Naïve Bayes:
It is a classifier that classification a statistical model for calculating the chances of a class containing each set of existing attributes, and from this, determines the most ideal class. All attributes are independent of each other, and they all contribute to decision-making [21]. Bayes’ theorem is represented in the below equation:
where P(ai) and P(bj) are event probability A and B with no considering each other. P(bj ∣ai) is the probability of bj conditional on ai and P(ai ∣bj) is of ai conditional on bj , B is represent the classification variable and A is a tuple of attribute values, (In naïve Bayes classification). When calculating the numerator value for each class and then choosing the class at which the value is the maximum, this rule is called as the maximal a posteriori (MAP) rule. The resulting class, calculated as y for the instance x, is determined using this simple naive Bayes classifier as: [22] .
2.7 K Nearest Neighbor (KNN):
It is a non-parametric algorithm which is usually employed to solve the classification problem, the information of points which are adjacent to each other is customs to classify the output labels under this approach [3] .
Algorithm K-NN steps can be written as:
1. input the data set , split it into training and testing sets.
2. select instances out of the test sets, then measure how faraway it is from the training set.
3. Listing the distances in ascending order.
4. The instance's category is the utmost particular one of the first triple training instances (k=3) [23] .
Performance evaluation of models:
To evaluate performance of algorithms, using a confusion matrix which made up of TP, FP, TN, and FN for real data and predicted data, where:
TP: represents the number of cases classified as True which are in fact True.
FN: represents the number of cases classified as False which are in fact True.
TN: represents the number of cases classified as False which are in fact False.
FP: represents the number of cases classified as True which are False [4].
(SE) Sensitivity: represents the probability value that the expected classification will be accurate for the accurate
case which is : SE =
(SP) Specificity: represents the value of the probability that the expected classification will be incorrect for the
case that is incorrect which is : SP =
(AC) Accuracy: represents the ratio of correctly classified and calculated as : AC =
Another important measure employed to evaluate effectiveness of the classifier is the ROC curve which plots 1- specificity on the x-axis and sensitivity on the y-axis, giving the zone under the curve which ranges through 0 to 1,which is a measure that measures the model's capability of distinguishing among cases [24],[25].
3. Results and Discussion
3.1 About data:
Cancer is a disease affecting females more than males. In 2015, more than 2.1 million people were diagnosed with the disease, representing 25% of all cancer cases. The disease begins as a tumor in breast cells, growing until they form lumps and begin to disseminate to further organs of the body. The main goal in diagnosing such tumors and distinguishing between malignant and benign ones. A Fine Needle Aspiration (FNA) of a breast lump is used to analyze the picture and assess the features. This is defined meticulously in: [K. P. Bennett and O. L. Mangasarian]: "Robust Linear Programming Discrimination of Two Linearly Inseparable Sets", Optimization Methods and Software 1, 1992, 23-34.This database can be found kaggle https://www.kaggle.com/datasets/uciml/breast-cancerwisconsin-data
3.2 Attribute Information and results:
Diagnosing (M = malignant, B = benign) is the dependent variable, the predictive variables are (30), the entire attribute values are recorded with four significant digits, and no missing values. The data consisted of a No. of instances: 569 and a No. of attributes: 32 (ID, diagnosis, 30 real-valued input features) Class distribution: 357 benign, 212 malignant, the percentage of B is (0.63) and (0.37) for M. For the purpose of analysis, the data fell into a percentage (0.8) for training and (0.2) for testing, the numeral amount of views for training (456) and testing (113).
between variables.
Figure 5. Compare methods using Specificity (SP) criteria. Logistic Regression, Elastic net Logistic, Decision Tree, Random Forest, Boosting, Naïve Bayes algorithms have broad tasks in classification and prediction. The performance of such algorithms was in comparison by employing a validation dataset in order to verify their performance after adequate training, it was conducted to evaluate their ability to predict future samples. In the current study, the Elastic net logistic model outperformed the rest of the models in breast cancer diagnosis by achieving the highest results, as its accuracy reached (%99.12) with a classification error (0.0088%) sensitivity (1%), Specificity (0.9859).
4. Conclusion
In the present research, the performance of several ML methods namely Logistic Regression, Elastic Net Logistic, Decision Tree, Random Forest, Boosting, Naïve Bayes, and K Nearest Neighbor was compared in diagnosing breast tumors, whether they are benign or malignant, on Wisconsin breast cancer data taken out of UCI ML repository or from Kaggle. The comparison was made on the basis of being sensitive, specific, precise, and classifying of error criteria. The findings uncovered that the algorithm Elastic Net Logistic outperformed the logistic regression algorithm in terms of error classification, sensitivity, specificity, and accuracy on testing data, which makes the model important in diagnosing breast tumors. It also features the ability to reduce variables close to zero, address multicollinearity, and reduce dimensionality issues, as it is a model that combines the Lasso and Ridge methods. Finally, we can recommend using regularization techniques such as Lasso and Ridge and using learning algorithms to compare and classify.