Predict method for jdify objects

# S3 method for jdify
predict(object, newdata, what = "class", threshold = 0.5,
  ...)

Arguments

object

an object of class jdify.

newdata

a data.frame containing the predictors.

what

either "class" for class predictions or "probs" for condition probability estimates.

threshold

threshold parameter for class prediction (what = "class"); predicts class \(C\) if \(Pr(C) \ge threshold\).

...

unused.

Value

A data frame containing the predictions.

Examples

# simulate training and test data dat <- data.frame( cl = as.factor(rbinom(10, 1, 0.5)), x1 = rnorm(10), x2 = ordered(rbinom(10, 1, 0.3), 0:1) ) # fit density with cctools package model <- jdify(cl ~ x1 + x2, data = dat, jd_method("cctools")) pred <- predict(model, dat) # class predictions probs <- predict(model, dat, what = "probs") # conditional probabilities