Research Article
Exploiting Machine Learning to Detect Malicious Nodes in Intelligent Sensor-Based Systems Using Blockchain
Algorithm 3
Detection of malicious nodes with classification by GA-DT.
1 load dataset; | 2 split the data 70% = testing and 30% = training; | 3 initialize hyperparameters (Maximum Depth, Minimum Sample Leaf, Minimum Sample Split, Criterion); | 4 GA:Maximum Depth, Minimum Sample Leaf, Minimum Sample Split, Criterion; | 5 initialize population | 6 (generation,populationsize,offspringsize); | 7 perform tuning of hyperparameters; | 8 perform selection; | 9 perform crossover; | 10 perform mutation; | ⊳Decision Tree is DT | 11 train DT on selected parameters; | 12 DT saves the model; | 13 DT tests the model; | 14 DT loads the model; |
|