teehr.metrics.deterministic_funcs.confusion_matrix#

confusion_matrix(model: MetricsBasemodel) Callable[source]#

Create the confusion_matrix metric function.

Returns counts of TP, TN, FP, FN as a dictionary.

\(TP=\sum((prim>=threshold_{prim})\ and\ (sec>=threshold_{sec}))\) \(TN=\sum((prim<threshold_{prim})\ and\ (sec<threshold_{sec}))\) \(FP=\sum((prim<threshold_{prim})\ and\ (sec>=threshold_{sec}))\) \(FN=\sum((prim>=threshold_{prim})\ and\ (sec<threshold_{sec}))\)