Skip to main content
. 2023 Jun 21;14:1158555. doi: 10.3389/fneur.2023.1158555

Algorithm 1.

Stacking pseudocode.

 
1: ————————Step 1: Input
Dataset D = {(x1(1), x2(1), ..., y(1)), (x1(2), x2(2), ..., y(2)), (x1(n), x2(n), ..., y(n))};
Primary learning algorithm :
PLA = {DNN, LSTM-RNN, DBN};
Secondary learning algorithm:Random Forest(RF)
3: ———————-Step 2:
Process
1: split D:Train_data, Testing_data
2: for t = 1, 2, ..., T do
3:      h(t) = Stratified Fold (Train_data);
4: end for
5:New_Train_data =Ø;
6: for i in PLA do
7:      for t = 1, 2, ..., T do
8:         Zit =h(t)(PLA(i));
9:      end for
10:  New_Train_data = ∪((Zi1, Zi1, ..., Zi1), yi);
11: end for
12: New_Test_data = Ø;
13: for i in PLA do
14:      for t = 1, 2, ..., T do
15:          Zit= h(t)(PLA(i));
16:      end for
17:   New_Test_data = ∪ ((Zi1, Zi1, ..., Zi1), yi);
18: end for
19: Training_RF = RF(New_Train_data)
3: ———————Step 3: Output
Testing_RF = Training_RF
   (h(1)(New_Test_data(1)), h(2)(New_Test_data(1)), ..., h(T)(New_Test_data(1)))