powered by
A function that trains a classifier based on the nearest centroid.
lol.classify.nearestCentroid(X, Y, ...)
[n, d] the data with n samples in d dimensions.
[n, d]
n
d
[n] the labels of the n samples.
[n]
optional args.
A list of class nearestCentroid, with the following attributes:
nearestCentroid
[K, d] the centroids of each class with K classes in d dimensions.
[K, d]
K
[K] the ylabels for each of the K unique classes, ordered.
[K]
[K] the priors for each of the K classes.
For more details see the help vignette: vignette("centroid", package = "lolR")
vignette("centroid", package = "lolR")
# NOT RUN { library(lolR) data <- lol.sims.rtrunk(n=200, d=30) # 200 examples of 30 dimensions X <- data$X; Y <- data$Y model <- lol.classify.nearestCentroid(X, Y) # }
Run the code above in your browser using DataLab