jdify: Joint density classification

Description Usage Arguments Details Value References See Also Examples

Description

Fits a generic joint density model for the predictors and class variables.

Usage

1
jdify(formula, data, jd_method = "cctools", ...)

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" or a character string for built-in methods, see jd_method().

...

additional parameters passed to fit_fun.

Details

For predicting the class or conditional probabilities, see, predict.jdify().

Value

An object of class jdify.

References

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

See Also

predict.jdify(), assess_clsfyr()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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)
)

model <- jdify(cl ~ x1 + x2, dat)              # fitted joint density
pred <- predict(model, dat)                    # class predictions
probs <- predict(model, dat, what = "probs")   # conditional probabilities

# in-sample performance
assess_clsfyr(probs[, 1], dat[, 1] == 0, measure = c("ACC", "F1"))

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