metrics.ctx_node_covlmc {mixvlmc} | R Documentation |
Predictive quality metrics for a node of a COVLMC context tree
Description
This function computes and returns predictive quality metrics for a node
(ctx_node_covlmc
) extracted from a covlmc
Usage
## S3 method for class 'ctx_node_covlmc'
metrics(model, ...)
Arguments
model |
A |
... |
Additional parameters for predictive metrics computation. |
Details
Compared to metrics.covlmc()
, this function focuses on a single context and
assesses the quality of its predictions, disregarding observations that have
other contexts. Apart from this limited scope, the function operates as
metrics.covlmc()
.
Value
an object of class metrics.covlmc
with the following components:
-
accuracy
: the accuracy of the predictions -
conf_mat
: the confusion matrix of the predictions, with predicted values in rows and true values in columns -
auc
: the AUC of the predictive model
References
David J. Hand and Robert J. Till (2001). "A Simple Generalisation of the Area Under the ROC Curve for Multiple Class Classification Problems." Machine Learning 45(2), p. 171–186. DOI: doi:10.1023/A:1010920819831.
See Also
metrics.vlmc()
, metrics.ctx_node()
, contexts.vlmc()
, predict.vlmc()
.
Examples
pc <- powerconsumption[powerconsumption$week == 5, ]
breaks <- c(
0,
median(powerconsumption$active_power, na.rm = TRUE),
max(powerconsumption$active_power, na.rm = TRUE)
)
labels <- c(0, 1)
dts <- cut(pc$active_power, breaks = breaks, labels = labels)
dts_cov <- data.frame(day_night = (pc$hour >= 7 & pc$hour <= 17))
m_cov <- covlmc(dts, dts_cov, min_size = 5)
m_ctxs <- contexts(m_cov)
## get the predictive metrics for each context
lapply(m_ctxs, metrics)