Input: data a labeled dataset with features
Output: PF a random forest model
(1) the number of decision trees, the number of selected features
(2) initialization , ,
(3) while do
(4)   draw a bootstrap sample of size from data
(5)   repeat
(6)   select features at random from the features
(7)   calculate the Gini coefficient of selected features
(8)   select the feature with lower Gini coefficient among the
(9)   split the node into two daughter nodes
(10)   until the minimum node size is reached
(11)  construct decision tree
(13) end while
Algorithm 1: Random forest algorithm.