Skip to main content
. 2019 Mar 8;19(5):1193. doi: 10.3390/s19051193
Algorithm 3 Training algorithm
1.  Construct set from sensor data: Given training set S, test set T, feature dimension F.
  Determine the parameters: The number of decision trees t, the depth of each tree d, and the number of features f used by each node.
  Termination conditions: The minimum number of samples on the node S, the minimum information gain on the node m.
2. From S, there is a training set S(i) of the same size as the extracted size S, 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 f dimensional features are randomly selected from the F dimensional features without replacement. Using this f dimensional feature, find the best one-dimensional feature k and its threshold th.
   The sample whose k dimension feature is less than th 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.