Skip to main content
. 2019 Nov 28;19(23):5236. doi: 10.3390/s19235236
Algorithm 3 Event classification penalty (ECPenalty).
Input:
GT={g1,g2gt} is the ground truth of appliance m
PT={p1,p2pt} is the predicted values of appliance m
CState is the clustered operational state data of appliance m
Output:
i=1TECi(m) is the total Event Classification Penalty for appliance m
  •   1:

    Set TotalPenaltym=0

  •   2:

    fort=1toTdo

  •   3:

      Get datapoint gt and pt

  •   4:

      if gt>0 and pt>0 then

  •   5:

        Compute closestCluster (gt,CState[Ci_Cmean])

  •   6:

        Set state of gt to Ci_Si

  •   7:

        Compute closestCluster (pt,CState[Ci_Cmean])

  •   8:

        Set state of pt to Ci_Si

  •   9:

      end if

  • 10:

      if state of gtpt then

  • 11:

        Set penalty ECt(m) equal to 1

  • 12:

      else

  • 13:

        Set penalty ECt(m) equal to 0

  • 14:

      end if

  • 15:

    end for

  • 16:

    returni=1TECi(m)