Skip to main content
. 2024 Feb 19;18:1324933. doi: 10.3389/fnins.2024.1324933

ALGORITHM 2.

Pseudo-Code function buildTree(X,H)
Input: Dataset X, Maximum height H
1: Output: Tree T
2: if H < = 0 or X is empty:
3: create leaf node T
4: return T
5: else:
6: randomly select a feature feat and a split point split
7: partition X into left subset X_left and right subset X_right based on feat and split
8: T = createSplitNode(feat, split)
9: T.leftChild = buildTree(X_left, H-1)
10: T.rightChild = buildTree(X_right, H-1)
11: return T