Predict method for jdify objects
# S3 method for jdify predict(object, newdata, what = "class", threshold = 0.5, ...)
object | an object of class |
---|---|
newdata | a |
what | either |
threshold | threshold parameter for class prediction ( |
... | unused. |
A data frame containing the predictions.
# 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