A function that predicts the maximally present class in the dataset. Functionality consistent
with the standard R prediction interface so that one can compute the "chance" accuracy
with minimal modification of other classification scripts.
Usage
# S3 method for randomChance
predict(object, X, ...)
Arguments
object
An object of class randomChance, with the following attributes:
ylabs[K] the ylabels for each of the K unique classes, ordered.
priors[K] the priors for each of the K classes.
X
[n, d] the data to classify with n samples in d dimensions.
...
optional args.
Value
Yhat [n] the predicted class of each of the n data point in X.
# NOT RUN {library(lolR)
data <- lol.sims.rtrunk(n=200, d=30) # 200 examples of 30 dimensionsX <- data$X; Y <- data$Y
model <- lol.classify.randomChance(X, Y)
Yh <- predict(model, X)
# }