C.FRNN.O.FRST: The fuzzy-rough ownership nearest neighbor algorithm

View source: R/NearestNeigbour.R

C.FRNN.O.FRSTR Documentation

The fuzzy-rough ownership nearest neighbor algorithm

Description

It is used to predict classes of new datasets/patterns based on the fuzzy-rough ownership nearest neighbor algorithm (FRNN.O) proposed by (Sarkar, 2007).

Usage

C.FRNN.O.FRST(decision.table, newdata, control = list())

Arguments

decision.table

a "DecisionTable" class representing the decision table. See SF.asDecisionTable. It should be noted that the data must be numeric values instead of strings/characters.

newdata

a "DecisionTable" class representing data for the test process.

See SF.asDecisionTable.

control

a list of other parameters.

  • m: the weight of distance. The default value is 2.

Details

This method improves fuzzy k-nearest neighbors (FNN) by introducing rough sets into it. To avoid determining k by trial and error procedure, this method uses all training data. Uncertainties in data are accommodated by introducing the rough ownership function. It is the following equation o_c of each class expressing a squared weighted distance between a test pattern and all training data d and constrained fuzzy membership \mu_{C_c}.

o_c(y) = \frac{1}{|X|}\mu_{C_c}(x)\exp{(-d^{1/(q-1)})}

where d = \sum_{j=1}^{N}K_j(y_j-x_{ij})^2

The predicted value of y is obtained by selecting class c where o_c(y) is maximum.

Value

A matrix of predicted classes of newdata.

Author(s)

Lala Septem Riza

References

M. Sarkar, "Fuzzy-Rough Nearest-Neighbor Algorithm in Classification" Fuzzy Sets and Systems, vol. 158, no. 19, p. 2123 - 2152 (2007).

See Also

C.FRNN.FRST, C.POSNN.FRST

Examples

#############################################################
## In this example, we are using Iris dataset.
## It should be noted that since the values of the decision attribute are strings,
## they should be transformed into numeric values using unclass()
#############################################################
data(iris)
## shuffle the data
set.seed(2)
irisShuffled <- iris[sample(nrow(iris)),]

## transform values of the decision attribute into numerics
irisShuffled[,5] <- unclass(irisShuffled[,5])

## split the data into training and testing data
iris.training <- irisShuffled[1:105,]
iris.testing <- irisShuffled[106:nrow(irisShuffled),1:4]

## convert into the standard decision table
colnames(iris.training) <- c("Sepal.Length", "Sepal.Width", "Petal.Length", 
                             "Petal.Width", "Species")
decision.table <- SF.asDecisionTable(dataset = iris.training, decision.attr = 5, 
                                    indx.nominal = c(5))
tst.iris <- SF.asDecisionTable(dataset = iris.testing)

## in this case, we are using "gradual" for type of membership					   
control <- list(m = 2)

## Not run: res.test.FRNN.O <- C.FRNN.O.FRST(decision.table = decision.table, newdata = tst.iris, 
                                 control = control)
## End(Not run)


RoughSets documentation built on May 29, 2024, 7:34 a.m.