Description Usage Arguments Value Author(s) See Also Examples
View source: R/machinelearning-functions-knntl.R
Classification using a variation of the KNN implementation of Wu and Dietterich's transfer learning schema
1 2 | knntlClassification(primary, auxiliary, fcol = "markers", bestTheta, k,
scores = c("prediction", "all", "none"), seed)
|
primary |
An instance of class |
auxiliary |
An instance of class
|
fcol |
The feature meta-data containing marker definitions.
Default is |
bestTheta |
Best theta vector as output from
|
k |
Numeric vector of length 2, containing the best |
scores |
One of |
seed |
The optional random number generator seed. |
A character vector of the classifications for the unknowns
Lisa Breckels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(pRolocdata)
data(andy2011)
data(andy2011goCC)
## reducing calculation time of k by pre-running knnOptimisation
x <- c(andy2011, andy2011goCC)
k <- lapply(x, function(z)
knnOptimisation(z, times=5,
fcol = "markers.orig",
verbose = FALSE))
k <- sapply(k, function(z) getParams(z))
k
## reducing parameter search with theta = 1,
## weights of only 1 or 0 will be considered
opt <- knntlOptimisation(andy2011, andy2011goCC,
fcol = "markers.orig",
times = 2,
by = 1, k = k)
opt
th <- getParams(opt)
plot(opt)
res <- knntlClassification(andy2011, andy2011goCC,
fcol = "markers.orig", th, k)
res
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.