Research Article

A New Random Forest Algorithm Based on Learning Automata

Algorithm 2

The pseudocode of the proposed method.
Input D={(x1, y1), (x2, y2), …, (xN, yN),} denote the training data with xi = (xi,1, xi,2, …, xi,p)
(1)Output classified test data
(2)Assumption
(3)LA : Learning automata
(4)DTr = {DT1, DT2, … , DTR} denote the base learners
(5)αi: LA action//Choose DTr
(6)a: Reward parameter
(7)b: Penalty parameter
(8)Pool : All the trained base learners
(9)Algorithm
(10)For r = 1 to R do
(11)  Create a dataset Dt, by sampling (N/R) items, randomly with replacement from D
(12)  Train DTr using Dt, and add to the pool
(13)end//for
(14)For each test sample
(15)  {
(16)  LA = new LA//Create an LA object from LA class
(17)  While ((LA convergences to an action) or (LA exceeds predefined iteration number))
(18)  {
(19)  Select one of the actions at random and execute it, by the LA, Let it be αi
(20)  If (αi predicts the new test sample correctly) then//Update the probability of selection vector
(21)   //reward the selected αi
(22)  else
(23)    //Penalty the selected αi
(24)  }//end while
(25) }//end for
(26)Return DTr
(27)Classified test data = the prediction of DTr
(28)End.//algorithm