Skip to main content
. 2021 Jul 1;23(7):850. doi: 10.3390/e23070850
Algorithm 1 Pseudo-code of the algorithm of the intuitive classifier I.
  • 1:

    INPUT:

  • 2:

    S: training data sample with C columns and N rows

  • 3:

    C1 attributes are the antecedent

  • 4:

    1 class variable is the consequent

  • 5:

    START ALGORITHM

  • 6:

    CRS {/*initialized as void set*/}

  • 7:

    for each row in S do

  • 8:

    if there exists a rule Rj in CRS such that Antecedent(Rj) = Antecedent(row) and Consequent(Rj) = Consequent(row) then

  • 9:

      for all Ri in CRS such that Antecedent(Ri) = Antecedent(row) do

  • 10:

       Ri.supp ← Ri.supp + 1

  • 11:

      end for

  • 12:

      Rj.conf ← Rj.conf + 1

  • 13:

    else

  • 14:

      R ← New Rule

  • 15:

      R.antecedent ← Antecedent(row)

  • 16:

      R.consequent ← Consequent(row)

  • 17:

      R.supp ← 1

  • 18:

      R.conf ← 1

  • 19:

      for all Ri in CRS such that Antecedent(Ri) = Antecedent(row) do

  • 20:

       Ri.supp ← Ri.supp + 1

  • 21:

      end for

  • 22:

      CRS← CRS + R {/*add R to CRS*/}

  • 23:

    end if

  • 24:

    end for

  • 25:

    returnCRS: Classification Rule Set {/*OUTPUT*/}

  • 26:

    END ALGORITHM