Skip to Content
BayesiaLabKey ConceptsContingency Table Fit

Contingency Table Fit

Definition

Contingency Table Fit (CTF) measures the quality of the representation of the Joint Probability Distribution by a Bayesian network BB compared to a complete (i.e., fully-connected) network CC.

BayesiaLab’s CTF is defined as:

CB=100×HU(D)−HB(D)HU(D)−HC(D)C_B = 100 \times \frac{H_U(\mathcal{D}) - H_B(\mathcal{D})}{H_U(\mathcal{D}) - H_C(\mathcal{D})}

where

  • HU(D)H_U(\mathcal{D}) is the entropy of the data with the unconnected network UU.
  • HB(D)H_B(\mathcal{D}) is the entropy of the data with the evaluated network BB.
  • HC(D)H_C(\mathcal{D}) is the entropy of the data with the complete (i.e., fully connected) network CC. In the complete network, all nodes are directly connected to all other nodes. Therefore, the complete network CC is an exact representation of the chain rule. As such, it does not utilize any conditional independence assumptions for representing the Joint Probability Distribution.

Interpretation

When the baseline and complete model have different entropy scores:

  • CB=100C_B=100 when BB has the same entropy score as the complete network CC.
  • CB=0C_B=0 when BB has the same entropy score as the unconnected network UU.

CBC_B can also be negative if the parameters of network BB do not correspond to the dataset.

Loading SVG...

In the El Paso example, the complete model reduces mean log-loss by 4.8999 bits per record relative to the unconnected model. The evaluated model reduces it by 4.2892 bits, closing 87.54% of that gap.

Q&A

CTF value

Question

How much weight should one place on the CTF metric reported out in the Data Clustering results, as a measure of the “goodness” of a cluster/segmentation solution? Across about a dozen different datasets (using both latent and manifest variables as inputs) I have never seen a CTF higher than about 11%, which is substantially lower than what is mentioned in the Data Clustering webinar.

I am just trying to understand whether this might be a function of the data, the modeling assumptions/structure I am making/imposing, or something else.

Answer

When used as a quality measure for Data Clustering, the CTF measures how well the states of your Cluster node summarize the Joint. The size of the Joint (defined by the number of variables and states) has then a great impact on the difficulty to get a good summary. The second difficulty comes from the strength of the probabilistic interactions between the variables. The more the relationships are weak, the more difficult it is to summarize the Joint (as probabilities are then spread all over the hypercube).

For an induced Factor in Multiple Clustering, we historically used a 75% warning threshold when summarizing the joint distribution of five manifest variables. If each has five states, their Joint Probability Table has 3,125 cells. A five-state Factor with a CTF of 75% closes 75% of the gap in entropy scores between the independence baseline and the complete model. The manifest variables in this example were clustered together because of the strength of their interactions.