View source: R/machinelearning-functions-knntl.R
knntlClassification | R Documentation |
Classification using a variation of the KNN implementation of Wu and Dietterich's transfer learning schema
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
knntlOptimisation
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.