Skip to main content
. 2022 Sep 21;22(19):7169. doi: 10.3390/s22197169
Algorithm 1: Algorithm for Collecting Data from IoT Sensors in Smart Cities.
Begin
  Input: A= {a1…an}-instance, R- result  // training data
For each instance
  Initially, the sensor finds a neighbour sensor, NN
  p (b, a) = p (b| a) p (a)
      P(b/a)=pbp(a|b)pa  //Compute the probability of b given a:
The end for // testing data
Repeat
 For ak ϵ A
    Compute p (b, a) = p (b, ak) p (a| b, ak)
       P(b/a)=pb,akp(a|b, ak)pa
 Get R☐ node NN
 Return class value
 Update classifier
 End for
 Until Convergence
End.