Learn R Programming

lfl (version 1.0)

fsets: A class of a table with several fuzzy sets.

Description

The aim of the fsets S3 class is to store several fuzzy sets in the form of numeric matrix where columns represent fuzzy sets and values are membership degrees. The fsets class also stores the information about the origin of the fuzzy sets as well as a relation of specificity among them.

Usage

fsets(x, vars, specs)

vars(x)

specs(x)

Arguments

x
A matrix of membership degrees. Columns of the matrix represent fuzzy sets, colnames are names of the fuzzy sets (and must not be NULL).
vars
A (typically character) vector that must correspond to the columns of x. It is a vector of names of original variables that the fuzzy sets were created from. In other words, the vars vector should contain the same
specs
A square numeric matrix containing values from ${0, 1}$. It is a specificity matrix for which each row and column corresponds to an x's column. specs[i][j] = 1 if and only if the $i$-th fuzzy set (i.e. x[, i

Value

  • fsets returns an object of class fsets.

    vars returns a vector of original variable names of the fsets object (see the description of the vars argument above).

    specs returns the specificity matrix of the fsets object (see the description of the specs argument above).

Details

The fsets function is a constructor for an instance of the fsets class. Their vars and specs arguments are stored into attributes of the objects. The functions vars and specs can be used to access that objects.

See Also

fcut, lcut, is.specific

Examples

Run this code
# create a matrix of random membership degrees
    m <- matrix(runif(30), ncol=5)
    colnames(m) <- c('a1', 'a2', 'a12', 'b1', 'b2')

    # create vars - first three (a1, a2, a3) and next two (b1, b2)
    # fuzzy sets originate from the same variable
    v <- c('a', 'a', 'a', 'b', 'b')
    names(v) <- colnames(m)

    # create specificity matrix - a1 and a2 are subsets of a12,
    # the rest is incomparable
    s <- matrix(c(0, 0, 1, 0, 0,
                  0, 0, 1, 0, 0,
                  0, 0, 0, 0, 0,
                  0, 0, 0, 0, 0,
                  0, 0, 0, 0, 0), byrow=TRUE, ncol=5)
    colnames(s) <- colnames(m)
    rownames(s) <- colnames(m)

    # create a valid instance of the fsets class
    o <- fsets(m, v, s)

Run the code above in your browser using DataLab