Learn R Programming

RoughSets (version 1.0-0)

predict.RuleSetRST: The predicting function for rule induction methods based on RST

Description

It is a function used to obtain predicted values after obtaining rules by using rule induction methods. We have provided the functions RI.indiscernibilityBasedRules.RST to generate rules based on RST.

Usage

## S3 method for class 'RuleSetRST':
predict(object, newdata,
    votingScheme = X.bestFirst, ...)

Arguments

object
a "RuleSetRST" class resulted by RI.indiscernibilityBasedRules.RST.
newdata
a "DecisionTable" class containing a data frame or matrix (m x n) of data for the prediction process, where m is the number of instances and n is the number of input attributes. It should be noted that this data must have colnam
votingScheme
a function used to choose predicted values. The default value is X.bestFirst.
...
the other parameters.

Value

  • The predicted values.

See Also

RI.GFRS.FRST and RI.hybridFS.FRST.

Examples

Run this code
##############################################
## Example: Classification Task
##############################################
data(RoughSetData)
decision.table <- RoughSetData$hiring.dt

#### Rule induction based on RST ####
## determine feature subset/reduct
reduct <- FS.permutation.heuristic.reduct.RST(decision.table,  permutation = NULL)

## generate rules
rules.rst <- RI.indiscernibilityBasedRules.RST(decision.table, reduct)

## predicting newdata
## in this case, we are using the same dataset as training data
res.1 <- predict(rules.rst, decision.table[, -ncol(decision.table)])

Run the code above in your browser using DataLab