SF.asDecisionTable | R Documentation |
DecisionTable
objectThis function converts data.frames
into DecisionTable
objects. This is a standard data representation
in the RoughSets
package.
SF.asDecisionTable(dataset, decision.attr = NULL, indx.nominal = NULL)
dataset |
data.frame that contains objects/instances and attributes/features in its rows and columns, respectively.
See in Section |
decision.attr |
an integer value representing the index position of the decision attribute. If this parameter is ignored, then the function will treat the data as an information system or newdata/test data. In other words, it is necessary to define the index of the decision attribute in order to construct a decision table (e.g. a training data set). |
indx.nominal |
a logical vector indicating nominal attributes in the data. If this parameter is not given, then the function will use a heuristic to guess which of the attributes are nominal. The following rules will be applied used:
|
An object of the "DecisionTable"
class adds a few attributes to a standard data.frame:
desc.attrs
: a list containing the names of attributes and their range/possible symbolic values.
There are two kinds of representation in this parameters which depend on whether the attributes are
nominal or numeric, for example:
nominal attribute: a = c(1,2,3)
means that the attribute a
has values 1, 2, and 3.
numeric attribute: a = c(10, 20)
means that the attribute a
has values between 10 and 20.
nominal.attrs
: a logical vector whose length equals the number of columns in the data. In this vector TRUE
values
indicate that the corresponding attribute is a nominal. For example:
nominal.attrs = c(FALSE, TRUE, FALSE)
means that the first and third attributes
are numeric and the second one is nominal.
decision.attr
: a numeric value representing the index of the decision attribute. It is necessary to define
the index of the decision attribute in order to construct a proper decision system. If the value
of decision.attr
is NULL, the constructed object will correspond to an information system.
It is strongly recommended to place the decision attribute as the last data column.
"DecisionTable"
objects allow to use all methods of standard data.frame objects.
The function SF.read.DecisionTable
can be used to import data from a file and then construct DecisionTable
object.
An object of the "DecisionTable"
class.
Andrzej Janusz
SF.read.DecisionTable
, SF.applyDecTable
.
################################################################
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.