Skip to main content
. 2024 Mar 15;14(6):624. doi: 10.3390/diagnostics14060624
Algorithm 3: Weighted random forest algorithm for dengue prediction
Input: Dengue Training Partition (P), Count of Trees (N), Features Subset—Random (FS)
Output: Random Forest (RF)
Tree with Dengue Prediction
For each i = 1 to N, do:
Apply bootstrap algorithm on training partition (P) such as Pi=bootstrap P.
Apply the Decision Tree (DT), DTi=Random Decision Tree P, FS.
Build the RF as  RF=RFDTi.
End for
For each i = 1 to N, do:
Calculate the weight (wit) of ith sample using Equation (1).
wit=1OBjϵOBXpred i,jXactual i,j (1)
End for
For each i = 1 to N, do:
i=fAUCwtIBi,AUCwtoBi (2)
End for
For each i = 1 to, do:
Calculate the weight (wi) using Equation (3).
wi=Npi+1kk=1NTNpi+1 k  (3)
For each i = 1 to N, do:
Calculate the Final Prediction using Equation (4).
X_predi=1NTj=1NTX_predi,j×wj (4)
End for
Return RF.