Learn R Programming

lfl (version 1.2)

searchrules: Searching for fuzzy association rules

Description

This function searches the given fsets object d for all fuzzy association rules that satisfy defined constraints. It returns a list of fuzzy association rules together with some statistics characterizing them (such as support, confidence etc.).

Usage

searchrules(d,
            lhs=2:ncol(d),
            rhs=1,
            tnorm=c("minimum", "product", "lukasiewicz"),
            n=100,
            best=c("confidence"),
            minSupport=0.02,
            minConfidence=0.75,
            maxConfidence=1,
            maxLength=4,
            numThreads=1,
            trie=(maxConfidence < 1))

Arguments

d
An object of class fsets - it is basically a matrix where columns represent the fuzzy sets and values are the membership degrees. For creation of such object, use fcut

Value

  • A list of the following elements: rules and statistics.

    rules is a list of mined fuzzy association rules. Each element of that list is a character vector with consequent attribute being on the first position.

    statistics is a data frame of statistical characteristics about mined rules. Each row corresponds to a rule in the rules list. Let us consider a rule "a & b => c", let $\otimes$ be a t-norm specified with the tnorm parameter and $i$ goes over all rows of a data table d. Then columns of the statistics data frame are as follows:

    • support
    {a rule's support degree: $1/nrow(d) * \sum_{\forall i} a(i) \otimes b(i) \otimes c(i)$}

  • lhsSupporta support of rule's antecedent (LHS): $1/nrow(d) * \sum_{\forall i} a(i) \otimes b(i)$
  • rhsSupporta support of rule's consequent (RHS): $1/nrow(d) * \sum_{\forall i} c(i)$
  • confidencea rule's confidence degree: $support / lhsSupport$

Details

The function searches data frame d for fuzzy association rules that satisfy conditions specified by the parameters.

See Also

fcut, lcut, farules, fsets, pbld

Examples

Run this code
d <- lcut3(CO2)
  searchrules(d, lhs=1:ncol(d), rhs=1:ncol(d))

Run the code above in your browser using DataLab