copulaClassifier {MLCOPULA} | R Documentation |
Train a classification model using copula functions.
Description
It trains a classification model based on copulas, the joint density of copulas is built with tree or chain graphic model, as shown in Salinas-Gutiérrez et al., 2014.
Usage
copulaClassifier(
X,
y,
distribution = "kernel",
copula = "frank",
weights = "likelihood",
graph_model = "tree",
k = 7,
m = 7,
method_grid = "ml"
)
Arguments
X |
Data frame with |
y |
a vector of size |
distribution |
Marginal distribution to be used: "normal" or "kernel", by default kernel. |
copula |
Character or vector with the name of the copula to be used: "frank", "gaussian", "clayton", "joe", "gumbel", "amh","grid", by default "frank". For parametric copulas, "frank", "gaussian", "clayton", "joe", "gumbel", "amh", one or more copulas can be selected. For nonparametric copula, only "grid" can be selected. See the examples for more details. |
weights |
Character with the weight construction method: "likelihood" or "mutual_information", by default "likelihood". |
graph_model |
Character with the graphical model structure: "tree" or "chain", by default "tree". |
k |
Only for grid copula. Positive integer indicating the
number of subintervals for the |
m |
Only for grid copula. Positive integer indicating the number
of subintervals for the |
method_grid |
Only for grid copula. Fitting method, least squares "ls" or maximum likelihood "ml", by default "ml". |
Value
Returns a list with the trained model.
References
Salinas-Gutiérrez, R., Hernández-Aguirre, A., Villa-Diharce, E.R. (2014). Copula selection for graphical models in continuous Estimation of Distribution Algorithms. Computational Statistics, 29(3–4):685–713. doi:10.1007/s00180-013-0457-y
Examples
X <- iris[,1:4]
y <- iris$Species
model <- copulaClassifier(X = X, y = y, copula = "frank",
distribution = "kernel", graph_model = "tree")
y_pred <- copulaPredict(X = X, model = model)
table(y,y_pred$class)
#Example 2
X <- iris[,1:4]
y <- iris$Species
model <- copulaClassifier(X = X, y = y, copula = c("frank","clayton"),
distribution = "kernel", graph_model = "chain")
y_pred <- copulaPredict(X = X, model = model)
table(y,y_pred$class)