View source: R/NearestNeigbour.R
C.FRNN.O.FRST | R Documentation |
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).
C.FRNN.O.FRST(decision.table, newdata, control = list())
decision.table |
a |
newdata |
a See |
control |
a list of other parameters.
|
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.
A matrix of predicted classes of newdata.
Lala Septem Riza
M. Sarkar, "Fuzzy-Rough Nearest-Neighbor Algorithm in Classification" Fuzzy Sets and Systems, vol. 158, no. 19, p. 2123 - 2152 (2007).
C.FRNN.FRST
,
C.POSNN.FRST
#############################################################
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.