Evaluation, diagnostics, benchmarks, and additional tests · Evaluation, diagnostics, benchmarks, and additional hypothesis tests · EVA012 · Metric
Variation of information
Measures information lost or gained when one partition is replaced by another.
In CodeSplash
A CodeSplash method runs this entry in Python and R. Set it up from the method's page.
- Compare two partitions (ARI, AMI, VI, purity) Verified in Python and R
Do it in CodeSplash Run it on your own data, in Python or R.
- Availability
- Runs in CodeSplash
- Code example
- Complete calculation
- Who ran it
- CodeSplash's run and the reference's record
- CodeSplash's run
- Verified in Python and R through discover.compare_partitions. The reference's example ran in Python and R here, and they agree.
- The reference's record
- Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.
Purpose
Measures information lost or gained when one partition is replaced by another.
Question / hypotheses
How different are two partitions in information units? Smaller is more similar.
Architecture / computational structure
A fixed scoring/calibration pipeline applied to model outputs or supplied observations; the formula and usage sections identify its operations.
Assumptions
Both partitions label the same observations; define the logarithm base and weighting. Very small or empty cells require a zero-log-zero convention.
Formula / computational definition
Parameters and notation
H and I are entropy and mutual information. Log base determines nats versus bits. No neural parameters or optimization are involved.
Fitting, fine-tuning, and adaptation
There is no model fine-tuning step for this evaluation procedure. Freeze the evaluated systems and evaluator before the final test. Select evaluation settings on development data; if a learned evaluator or calibration model is adapted, use separate fitting data, version it, and reassess its validity.
How to use and calibrate
Inspect both conditional entropies to distinguish splitting from merging, and report cluster counts. Use a common sample universe for all comparisons.
Example application
Quantify how much a refined community detection solution changes the original network partition.
Interpretation / pitfalls
Watch out
Unlike adjusted scores, raw VI is not chance corrected. Its upper bound depends on sample count and attainable partitions; do not compare values across unrelated sample sizes without context.
Python and R code examples
Scope: Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.
Validation: Python — Executed successfully on synthetic inputs. R — reviewed but not executed in this environment. Python dependencies are explicit imports; R uses base R unless a package/bridge is explicitly named.
Python and R
The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.
Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline. · needs numpy, sklearn
import numpy as np
from sklearn.metrics import mutual_info_score
a=[0,0,0,1,1,1]; b=[1,1,0,0,0,0]
def H(x):
p=np.unique(x,return_counts=True)[1]/len(x); return -np.sum(p*np.log(p))
print(H(a)+H(b)-2*mutual_info_score(a,b))
Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.
T <- table(c(0,0,0,1,1,1),c(1,1,0,0,0,0)); P <- T/sum(T)
p <- rowSums(P); q <- colSums(P); nz <- P>0
I <- sum(P[nz]*log((P/outer(p,q))[nz])); H <- function(x) -sum(x[x>0]*log(x[x>0]))
print(H(p)+H(q)-2*I)
Sources
- Source 1stat.washington.edu
From the CodeSplash reference, entry EVA012.