Skip to main content
. 2022 Sep 28;19(19):12378. doi: 10.3390/ijerph191912378
Algorithm 8: The procedure for applying the DT diabetes detection model
    Input: Input feature vector with n-samples and d-dimension XRn×d and true
     label YRn×1
    Result: The posterior P[0,1]    
  1 Divide θ=(j,tm) into Qleft(θ) and Qright(θ) subsets, where θ consisting of a feature, j and threshold, tm.    
  2 Use an impurity function (H), which are given below, to calculate the impurity at the kth
    node, G(Q,θ)=nleftNmH(Qleft(θ))+nrightNmH(Qright(θ)), where
    H=cPmC×(1PmC) or H=cPmC×log(PmC) and
    PmC=1NmxiRmI(yi=C)    
  3 Reduce the impurity by selecting the parameters, θ*=argminθG(Q,θ).    
  4 Reapply the preceding steps for subsets Qleft(θ*) and Qright(θ*) until depth reach to
    Nm<samples(minimum) or Nm=1.