Description Usage Arguments Value Examples
View source: R/validation_tools.R
Computes the precision based on the clustering
1 | Precision_Recall(hx, Truth)
|
hx |
a numeric vector of cluster selection |
Truth |
the ground truth for clusters |
The number of true positive links
The number of true negative links
The number of false positive links
The number of false negative links
The precision, defined by Pr = \frac{TP}{TP+FP}
The recall, defined by R = \frac{TP}{TP+FN}
The F1 index, defined by F1 = \frac{2\times P \times R}{P + R}
Rand Index, defined by RI = \frac{TP+TN}{TP+TN+FP+FN}
Is positives + negatives equal to total number of links - returns absolute difference if false
list with relevant metrics to evaluate clustering
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(123)
#1: Cluster data
FQC<-FlashQC(QuantumClone::Input_Example,conta = c(0,0),Nclus = 2:10)
#2: Compute NMI
Precision_Recall(hx = FQC$cluster,Truth = QuantumClone::Input_Example[[1]]$Chr)
### From Stanford NLP example:
cluster<-c(rep(1,6),rep(2,6),rep(3,5))
truth<-c(rep(1,5),2,
1,rep(2,4),3,
rep(1,2),rep(3,3))
Precision_Recall(cluster,truth)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.