Skip to main content
. 2024 Feb 21;24(5):1399. doi: 10.3390/s24051399
Algorithm 3 Serial implementation of eXtreme Gradient Boosting
Input: input_data → Features, thresholds, left and right
            children’s nodes
1: Step 1: Development of the tree_structure function
2: The single tree outputs the probability value of its class
3: Step 2: Building of the forest
4: for i=0 to nclass1
5:  for e=0 to ntrees1
6:     Zi+=tree_strucutre(input_data, e  nclass+i);
7:  end
8: end
9: Step 3:Final probability array through softmaxfunction
10: for i=0 to nclass1
11:    ZEi=expZi;
12: end
13: for i=0 to nclass1
14:    z=inclassZEi;
15: end
16: for i=0 to nclass1
17:    Pi=ZEi/z;
18: end
19: Find imax, index of the Pi maximum
Output: imax