VariationOfInformation<T>

Models & Types · AiDotNet.Clustering.Evaluation

Variation of Information (VI) for comparing clustering results.

Implements: IExternalClusterMetric<T>

For Beginners

Variation of Information asks “How different are these groupings?”

It measures the information distance between two clusterings:

  • VI = 0: Identical clusterings (no information lost or gained)
  • VI > 0: Different clusterings (some information differs)

Unlike other metrics, LOWER is better for VI (it’s a distance measure).

Think of it as: “How much would I need to change one grouping to get the other?”

How It Works

Variation of Information is an information-theoretic measure of the distance between two clusterings. It measures the amount of information lost and gained when going from one clustering to another.

VI(C, K) = H(C) + H(K) - 2*I(C, K) = H(C|K) + H(K|C) Where:

  • H(C) = entropy of true clustering
  • H(K) = entropy of predicted clustering
  • I(C, K) = mutual information
  • H(C|K) = conditional entropy of C given K

Constructors

Constructor Summary
VariationOfInformation(bool normalized) Initializes a new VariationOfInformation instance.

Methods

Method Summary
double Compute(Vector<T> trueLabels, Vector<T> predictedLabels)
double ComputeAMI(Vector<T> trueLabels, Vector<T> predictedLabels) Computes the Adjusted Mutual Information (AMI).
double ComputeNMI(Vector<T> trueLabels, Vector<T> predictedLabels) Computes the Normalized Mutual Information (NMI).