# Vibration Signal Classification Using Stochastic Configuration Networks Ensemble
## 3 Fault Diagnosis Based on Ensemble SCNs
### SCNs Ensemble
```
Input: Training inputs \(\mathbf{D}=\{D_{1},D_{2},...,D_{N}\},D_{i}\in R^{\text{H}}\), \(\mathbf{X}=\{x_{1},x_{2},...,x_{N}\},x_{i}\in R^{d2\times d3}\) and hybrid data \(\mathbf{Z}=\{z_{1},z_{2},...,z_{N}\}\), \(z_{i}\in R^{d}\); outputs \(\mathbf{T}=\{t_{1},t_{2},...,t_{N}\},t_{i}\in R^{n}\); The maximum number of hidden nodes \(L_{max}\); The expected error tolerance \(\epsilon\); The maximum times of random configuration \(T_{max}\); Two sets of scalars \(\mathbf{Y}=\{\lambda_{1},...,\lambda_{out}\}\) and \(R=\{t_{1},...,t_{end}\}\). Output: An ensemble SCN model
1 Initialization: error \(\epsilon_{0}=[t_{1},t_{2},...,t_{N}]^{T}\), six empty sets \(\Omega_{i=1,2,3}\), \(W_{i=1,2,3}\); while\(L\leq L_{max}\) and \(||\epsilon_{0}||_{F}>\epsilon\)do
2 Phase 1: hidden parameters configuration; for\(\lambda\in\mathbb{X}\)do
3 for\(r\in R\)do
4 SCN-D model:learning the SCN model with frequency spectrum dataset \(\mathbf{D}\); for\(k=1,2,...,T_{max}\)do
5 Randomly assign \(w_{L}\) from \([-\lambda_{i},\lambda]^{d1}\), and calculate\(\mathbf{b}_{1}=-w1\xi_{L}^{T}D^{*}\);
6 Calculate \(h_{1L}\) by Equation (3) and \(\xi_{L,q}^{1}\) Equation (4);
7 Save \(w_{1L},b_{1L}\) in \(W_{1}\), \(\xi_{L}^{2}=\sum_{q=1}^{m}\xi_{L,u}^{2}\) in \(\Omega_{1}\) if the constraint Equation (5) is satisfied;
8
9 end if
10 if\(W_{1}\) is not emptythen
11 Find \(w_{1}^{1},b_{1}^{1},\) maximizing \(\xi_{L}^{(1)}\in\Omega_{1}\) and set the hidden output matrix \(\mathbf{H}_{1}=[h_{1L}^{*},h_{1L}^{*},...,h_{1L}^{*}]\); Break (go to Step 45);
12
13 else
14 Continue (go to Step 7);
15
16 end if
17 SCN-X model:learning the 2 DSCN model with time-frequency dataset \(\mathbf{X}\); for\(k=1,2,...,T_{max}\)do
18 Randomly assign \(u_{L},v_{L}\) from \([-\lambda,\lambda]^{d2}\), \([-\lambda,\lambda]^{d3}\), respectively, and calculate \(b_{2L}=-u\xi^{*}v_{L}\);
19 Calculate \(h_{2L}\) by Equation (10) and \(\xi_{L,q}^{2}\) Equation (4);
20 Save \(u_{L},v_{L},b_{2L}\) in \(W_{2}\), \(\xi_{L}^{(2)}=\sum_{q=1}^{m}\xi_{L,u}^{2}\) in \(\Omega_{2}\) if the constraint Equation (5) is satisfied;
21
22 end if
23 if\(W_{2}\) is not emptythen
24 Find \(u_{L}^{*},v_{L}^{*},b_{2L}^{*}\) maximizing \(\xi_{L}^{(2)}\in\Omega_{2}\) and set the hidden output matrix \(\mathbf{H}_{2}=[h_{2L}^{*},h_{2L}^{*},...,h_{2L}^{*}]\) ; Break (go to Step 45);
25
26 else
27 Continue (go to Step 19);
28
29 end if
30 SCN-H model:learning the SCN model with hybrid dataset \(\mathbf{Z}\); for\(k=1,2,...,T_{max}\)do
31 Randomly assign \(w\delta_{L}\) from \([-\lambda_{i},\lambda]^{d}\), and calculate\(\delta_{L}=-w\delta_{L}^{T}Z^{*}\); Calculate \(h\delta_{L}\) by Equation (15) and \(\xi_{L,q}^{3}\) Equation (4);
32 Save \(w\delta_{L},b_{2L}\) in \(W_{3}\), \(\xi_{L}^{(3)}=\sum_{q=1}^{m}\xi_{L,u}^{3}\) in \(\Omega_{3}\) if the constraint Equation (5) is satisfied;
33
34 end if
35 if\(W_{3}\) is not emptythen
36 Find \(w\delta_{L}^{*},b_{3L}^{*}\) maximizing \(\xi_{L}^{(3)}\in\Omega_{3}\) and set the hidden output matrix \(\mathbf{H}_{3}=[h_{3L}^{*},h_{3L}^{*},...,h_{3L}^{*}]\); Break (go to Step 45);
37
38 else
39 Continue (go to Step 31);
40
41 end if
42
43 end if
44
45 Phase 2: Output parameters calculation;
46
47 Concatenate the hidden feature matrix \(\widetilde{\mathbf{H}}=[\mathbf{H}_{1},\mathbf{H}_{2},\mathbf{H}_{3}]\); Calculate \(\beta^{*}=[\beta_{1}^{*},\beta_{2}^{*},...,\beta_{L}^{*}]^{T}\) based on Equation (17);
48 Calculate \(e_{L}=\widetilde{\mathbf{H}}\beta^{*}-\mathbf{T}\) and renew \(\epsilon 0:=e_{L},L=L+1\);
49
50 end if
51 Return:\(L^{*},\beta^{*}\), hidden parameters \(w1^{*},b1^{*},u^{*},v^{*},b2^{*},w3^{*},b3^{*}\). ```  
**Algorithm 2**SCNs ensemble