Skip to Content

Compression

Context

The fit of a model to a dataset and the efficiency of encoding the dataset with a model are closely related concepts. In this context, the “compression” achieved with a model can be used as a performance measure. Under Information Gain and Evidence Analysis, we discussed the Information Gain of a network with regard to a single set of evidence EE.

The Information Gain regarding evidence EE is the difference between the:

  • Log-Loss LLU(E)LL_U(E), given an unconnected network U, i.e., a so-called straw model, in which all nodes are marginally independent;
  • Log-Loss LLB(E)LL_B(E), given the current network BB.
IGB(E)=log2(P(e1,...,en)i=1nP(ei))=LLU(E)LLB(E)I{G_B}(E) = lo{g_2}\left( {{{P({e_1},...,{e_n})} \over {\prod\limits_{i = 1}^n {P({e_i})} }}} \right) = L{L_U}(E) - L{L_B}(E)

As a result, a positive value of Information Gain would reflect a “cost-saving” for encoding the evidence EE by virtue of having the network BB. In other words, encoding EE with network BB is less “costly” than without network BB.

In Validation Mode F5, select Menus > Analysis > Network Performance > Compression. A new report window opens, featuring a graph plus a range of metrics.

AnalysisNetworkPerformanceCompressionReport

The report window contains two histograms of the Log-Loss values computed from all observations in the dataset given:

  • The “current model”, i.e., the to-be-evaluated Bayesian network BB (blue bars).
  • The “straw model”, i.e., the unconnected network UU (red bars).

Furthermore, the report window includes numerous related measures:

  • Entropy HBH_B, based on the current model.
  • Entropy HUH_U, based on the “straw model.”
  • Mean Information Gain, i.e., the arithmetic mean of the Information Gain of each observation/evidence EE in the dataset.
  • Mean Compression, i.e., the arithmetic mean of the Compression of each observation/evidence EE in the dataset.

Compression

Compression is a concept that first appears in this context. Its definition is:

CmprB(E)=IGB(E)LLU(E)Cmp{r_B}(E) = \frac{IG_B(E)}{LL_U(E)}

So, by dividing the Information Gain IGB(E)IG_B(E) by the Log-Loss LLU(E)LL_U(E), we obtain the Compression measure.

The following table illustrates the calculation of all measures.

We use the same data and network as in the example in Overall Network Performance.

Evidence E from DatasetComputed Measures
MonthHourTemperatureShortwave Radiation (W/m2)Wind Speed (m/s)Energy Demand (MWh)Log-Loss (Bayesian Network)Log-Loss (Unconnected Network)Information GainCompression
LLB(E)L{L_B}(E)LLU(E)L{L_U}(E)IGB(E)=LLU(E)LLB(E)IG_{B}(E)=LL_{U}(E)-LL_{B}(E)CmprB(E)=IGB(E)LLU(E)Cmp{r_B}(E) = \frac{IG_B(E)}{LL_U(E)}
81836.57213.62157413.4222.068.6339%
81936.04105.911.9157413.5521.688.1338%
82034.7142.722.14148511.9319.47.4739%
82133.9402.75147011.9217.735.8133%
82233.1903.55137811.8117.735.9233%
82332.3804.21124913.6916.933.2319%
8031.5604.5111012.9116.934.0224%
8130.604.8103113.2116.933.7122%
8229.6604.997511.1614.73.5424%
8329.0204.694410.8514.73.8526%
Entropy HBH_BEntropy HUH_UMean Information GainMean Compression
Mean13.1717.464.2924%
Std. Dev.2.082.172.33
Minimum9.7514.37-12.5
Maximum31.7831.0616.3

Updated Terminology

Please note the updated terminology when referring to earlier versions of BayesiaLab.

DeprecatedCurrent
ConsistencyInformation Gain
Consistency GainMean Compression