Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/NearestNeigbour.R
It is a function used to implement the positive region based fuzzy-rough nearest neighbor algorithm (POSNN) which was proposed by (Verbiest et al, 2012) for predicting classes of new data.
1 | C.POSNN.FRST(decision.table, newdata, control = list())
|
decision.table |
a |
newdata |
a See |
control |
a list of other parameters which is the same as |
This method is aimed to improve the fuzzy-rough nearest neighbor algorithm (C.FRNN.FRST
) algorithm by considering the fuzzy positive region.
Basically the following steps are used to classify an instance t:
determine the set of k-nearest neighbor of t, NN.
assign t to the class C for which
\frac{\displaystyle∑\limits_{x \in NN} R(x,t)C(x)POS(x)}{\displaystyle∑\limits_{x \in NN} R(x,t)}
is maximal.
A matrix of predicted classes of newdata.
Lala Septem Riza
N. Verbiest, C. Cornelis and R. Jensen, "Fuzzy-rough Positive Region Based Nearest Neighbour Classification", In Proceedings of the 20th International Conference on Fuzzy Systems (FUZZ-IEEE 2012), p. 1961 - 1967 (2012).
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 31 32 | #############################################################
## 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]
colnames(iris.training) <- c("Sepal.Length", "Sepal.Width", "Petal.Length",
"Petal.Width", "Species")
## convert into the standard decision table
decision.table <- SF.asDecisionTable(dataset = iris.training, decision.attr = 5,
indx.nominal = c(5))
tst.iris <- SF.asDecisionTable(dataset = iris.testing)
## FRNN algorithm using lower/upper approximation: Implicator/tnorm based approach
control <- list(type.LU = "implicator.tnorm", k = 20, t.tnorm = "lukasiewicz",
type.relation = c("tolerance", "eq.1"), t.implicator = "lukasiewicz")
## Not run: res.test.POSNN <- C.POSNN.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.