predict.randomGuess: Randomly Guessing Classifier Prediction

Description Usage Arguments Value Author(s) Examples

View source: R/random_classifier.R

Description

A function that predicts by randomly guessing based on the pmf of the class priors. Functionality consistent with the standard R prediction interface so that one can compute the "guess" accuracy with minimal modification of other classification scripts.

Usage

1
2
## S3 method for class 'randomGuess'
predict(object, X, ...)

Arguments

object

An object of class randomGuess, 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.

Author(s)

Eric Bridgeford

Examples

1
2
3
4
5
library(lolR)
data <- lol.sims.rtrunk(n=200, d=30)  # 200 examples of 30 dimensions
X <- data$X; Y <- data$Y
model <- lol.classify.randomGuess(X, Y)
Yh <- predict(model, X)

lolR documentation built on July 8, 2020, 7:35 p.m.