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

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

View source: R/NearestNeigbour.R

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

1
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 μ_{C_c}.

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

where d = ∑_{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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#############################################################
## 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)

janusza/RoughSets documentation built on Jan. 26, 2020, 11:22 p.m.