# A Novel Approach for Fraud Detection in Blockchain-Based Healthcare Networks Using Machine Learning
## 4 Performance Evaluation  
The design stages of the proposed system pass through the data preparation stage, machine learning modeling, and Feature engineering. Data preparation or pre-processing transforms the raw data process making it suitable for analysis and running through machine learning algorithms to uncover insights and predictions [26]. Data preparation has several steps, such as data formatting, filtering, and data validation and cleansing. After the data preparation stage, it is time to develop the model. This stage involves three substages:  
* Model Selection and Assessment. It is the process of selecting the model type to see which one performs better (regression model, classification model, etc. );
* Model training: ML models tackle two problems, classification, and regression. There are algorithms used in each type, but some can be used in both types (for example, Decision Tree and KNN). In designing the ML algorithm, training is the most important step, which consists of passing the prepared data to the ML model to find patterns and make predictions. Over time, with training, the model gets better at predicting;
* Model Evaluation: after doing training, the final stage includes model performance which is evaluated in terms of different metrics, such as accuracy and precision [22]. It is important to mention that feature engineering is the advanced step used to derive some extra important features from existing features, which are then used for better data modeling. The proposed system architecture consists of two parts. In the first part, the medical data is checked before passing to the blockchain network. The second is after passing data to the blockchain. The datasets are split into 80% and 20% sets for training and tests, respectively. The training set is utilized for training the model to predict and be tested by the test set. In the model, we adopted the following algorithms:  
* Logistic regression: It is a supervised ML algorithm used for classification problems. It aims to map a function from the dataset's features to the targets to predict the probability that a new example belongs to one of the target classes [27];
* K Nearest Neighbors (KNN): It uses the Euclidean distance between data points to obtain neighbor data to work in the coordinate plane with the linear decomposition method;
* Support Vector Machine (SVM): SVM overcomes the problem of overfitting by expanding the concept of constructional risk minimization. Additionally, it examines the optimal hyperplane between the two classes [28];
* Naive Bayes: It is named because the calculations of the probabilities for each class are simplified to make their calculations tractable. It considers a classification algorithm for binary (two-class) and multiclass classification problems;
* Decision tree: It unites a series of the basic test efficiently and cohesively, where a numeric feature is compared to a threshold value in each test [29];
* Random forest: It is used for classification and regression and works on gathering the results. The predictions of several decision trees. In the end, it chooses the best output and the mean prediction or mode of the classes [30]. Evaluation metrics are accuracy, precision, recall, F1-score, execution time, Receiver Operating Characteristic-Area Under Curve (ROC-AUC), and scalability. The confusion matrix derives all the metrics or scores [31]. A confusion matrix is used to evaluate a classification model's performance. It compares the predicted values obtained from the machine learning model with actual target values. This way provides a holistic view of the performing classification model and the errors it may make [32]. As shown in Figure 6, the confusion matrix comprises different combinations of the predicted and actual values of a classifier (i.e., algorithm):  
1. True Positive (TP): The number of times the predicted value matches the actual value. The actual value was positive, and the model predicted a positive value;
2.