SF.asDecisionTable: Converting a data.frame into a 'DecisionTable' object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/IOFunctions.R

Description

This function converts data.frames into DecisionTable objects. This is a standard data representation in the RoughSets package.

Usage

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

Arguments

dataset

data.frame that contains objects/instances and attributes/features in its rows and columns, respectively. See in Section Details.

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 attribute contains character values or factors: it will be recognized as a nominal attribute.

  • an attribute contains integer or numeric values: it will be recognized as a numeric attribute.

  • indx.nominal: the indicated attributes will be considered as nominal.

Details

An object of the "DecisionTable" class adds a few attributes to a standard data.frame:

"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.

Value

An object of the "DecisionTable" class.

Author(s)

Andrzej Janusz

See Also

SF.read.DecisionTable, SF.applyDecTable.

Examples

1
2
3
4
5
6
7
################################################################
## 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)

janusza/RoughSets documentation built on May 31, 2018, 11:11 a.m.