metrics.ctx_node: Predictive quality metrics for a node of a context tree

View source: R/ctx_node_vlmc.R

metrics.ctx_nodeR Documentation

Predictive quality metrics for a node of a context tree

Description

This function computes and returns predictive quality metrics for a node (ctx_node) extracted from a context tree.

Usage

## S3 method for class 'ctx_node'
metrics(model, ...)

Arguments

model

T ctx_node object as returned by find_sequence().

...

Additional parameters for predictive metrics computation.

Details

Compared to metrics.vlmc(), 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.vlmc().

Value

The returned value is guaranteed to have at least three 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: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1023/A:1010920819831")}.

See Also

metrics.vlmc(), metrics.ctx_node(), contexts.vlmc(), predict.vlmc().

Examples

pc <- powerconsumption[powerconsumption$week == 5, ]
dts <- cut(pc$active_power, breaks = c(0, quantile(pc$active_power, probs = c(0.25, 0.5, 0.75, 1))))
model <- vlmc(dts)
model_ctxs <- contexts(model)
metrics(model_ctxs[[4]])

mixvlmc documentation built on June 8, 2025, 12:35 p.m.