Learn R Programming

RoughSets (version 1.0-0)

SF.asDecisionTable: The construction function

Description

It is a function used to construct a standard decision table in the RoughSets package. So, users are strongly recommended to call this function first before any other functions in this package.

Usage

SF.asDecisionTable(dataset, decision.attr = NULL,
    indx.nominal = NULL)

Arguments

dataset
a data frame representing the dataset that contains objects/instances and attributes/features in its rows and columns, respectively. See in Section Details.
decision.attr
a numeric value representing the index position of the decision attribute. If we ignore this parameter, then the function will treat the data as an information system or newdata/testing data. In other words, we must define the index of decision at
indx.nominal
a vector representing indexes of nominal values. It is used to define specific indexes as nominal attributes.

Value

  • A "DecisionTable" class which is the standard decision table.

Details

The RoughSets package requires a standard decision table to calculate a particular task. The standard decision table is a "DecisionTable" class which constitutes the set of all objects/instances (universe of discourse) and other attributes. The objects are built by a table or data frame where the number of rows and columns represent the number of objects/instances and attributes, respectively. Three important attributes that describe the decision table are as follows.
  • desc.attrs: a list containing the names of attributes and range of the data. There are two kinds of representation in this parameters which depend on whether the attributes are in symbolic/nominal or real values, for example:
    • symbolic/nominal attribute:a = c(1,2,3)means the attributeahas values 1, 2, and 3.
    • real/continuous attribute:a = c(10, 20)means the attributeahas values between 10 and 20.
  • nominal.attrs: a vector containing boolean values that show whether the related attributes is a nominal value or not. For example:nominal.attrs = c(FALSE, TRUE, FALSE)means that the first and third attributes are continuous attributes and otherwise for the second one.
  • decision.attr: a numeric value representing an index of the decision attribute. Users must define the index of the decision attribute when they want to construct a decision table or training dataset. But, it is a null value when constructing a testing dataset/newdata. It is strongly recommended that the index of decision attribute is put on the last column of the dataset.
It also has been provided the function SF.read.DecisionTable which is used to import from a file and then construct into the decision table.

Examples

Run this code
################################################################
## Example : converting from datasets in data.frame
##            into decision table
################################################################
## Let use iris which is available in R be dataset
decision.table <- SF.asDecisionTable(dataset = iris, decision.attr = 5,
                  indx.nominal = 5)

Run the code above in your browser using DataLab