Algorithm 3 Training algorithm |
1. Construct set from sensor data: Given training set , test set , feature dimension .
Determine the parameters: The number of decision trees , the depth of each tree , and the number of features used by each node. Termination conditions: The minimum number of samples on the node , the minimum information gain on the node . 2. From , there is a training set of the same size as the extracted size , as a sample of the root node, and training is started from the root node. 3. If: the termination condition is reached on the current node, Set the current node as a leaf node. If: the current node does not reach the termination condition, The dimensional features are randomly selected from the dimensional features without replacement. Using this dimensional feature, find the best one-dimensional feature and its threshold . The sample whose dimension feature is less than at the current node is divided into left nodes, and the rest is divided into right nodes. Continue to train other nodes. 4. Repeat 2, 3 until all nodes have been trained or marked as leaf nodes. 5. Repeat 2, 3, 4 until all decision trees have been trained. |