cv_jdify: Cross validation for joint density classification

Description Usage Arguments Value References Examples

Description

Performs k-fold cross validation for a jdify object.

Usage

1
cv_jdify(formula, data, jd_method = "cctools", folds = 10, cores = 1, ...)

Arguments

formula

an object of class "formula"; same as stats::lm().

data

matrix, data frame, list or environment (or object coercible by base::as.data.frame()) containing the variables in the model.

jd_method

an object of class "jd_method" defining the method for joint density estimation, see jd_method().

folds

number of folds.

cores

number of cores for parallelized cross validation (based on foreach::foreach()).

...

further arguments passed to fit_fun().

Value

A list with elements

References

Nagler, T. (2017). A generic approach to nonparametric function estimation with mixed data. arXiv:1704.07457

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# simulate training and test data
dat <- data.frame(
    cl = as.factor(rbinom(100, 1, 0.5)),
    x1 = rnorm(100),
    x2 =  ordered(rbinom(10, 1, 0.3), 0:1)
)

cv <- cv_jdify(cl ~ x1 + x2, dat)
probs <- cv$cv_probs
assess_clsfyr(probs[, 1], dat[, 1] == 0, measure = c("ACC", "F1"))

tnagler/jdify documentation built on May 31, 2019, 4:41 p.m.