Information Theory of Bayesian network
class pyagrum.InformationTheory(*args)
Section titled “class pyagrum.InformationTheory(*args)”This class gathers information theory concepts for subsets named X,Y and Z computed with only one (optimized) inference.
it=pyagrum.InformationTheory(ie,X,Y,Z)
- Parameters:
- ie (InferenceEngine) – the inference algorithme to use (for instance, pyagrum.LazyPropagation)
- X (int or str or iterable [**int or str ]) – a first nodeset
- Y (int or str or iterable [**int or str ]) – a second nodeset
- Z ( : int or str or iterable [**int or str ] (**optional )) – a third (an optional) nodeset
Example
Section titled “Example”import pyagrum as gumbn=pyagrum.fastBN('A->B<-C<-D->E<-F->G->A')ie=pyagrum.LazyPropagation(bn)it=pyagrum.InformationTheory(ie,'A',['B','G'],['C'])print(f'Entropy(A)={it.entropyX()}'')print(f'MutualInformation(A;B,G)={it.mutualInformationXY()}')print(f'MutualInformation(A;B,G| C)={it.mutualInformationXYgivenZ()}')print(f'VariationOfInformation(A;B,G)={it.variationOfInformationXY()}')entropyX()
Section titled “entropyX()”- Returns: The entropy of nodeset X.
- Return type: float
entropyXY()
Section titled “entropyXY()”- Return type:
float - Returns: float : The entropy of nodeset, union of X and Y.
entropyXYgivenZ()
Section titled “entropyXYgivenZ()”- Return type:
float
entropyXgivenY()
Section titled “entropyXgivenY()”- Return type:
float - Returns: float : The conditional entropy of nodeset X conditionned by nodeset Y
entropyY()
Section titled “entropyY()”- Return type:
float - Returns: float : The entropy of nodeset X.
entropyYgivenX()
Section titled “entropyYgivenX()”- Return type:
float - Returns: float : The conditional entropy of nodeset Y conditionned by nodeset X
mutualInformationXY()
Section titled “mutualInformationXY()”- Return type:
float
mutualInformationXYgivenZ()
Section titled “mutualInformationXYgivenZ()”- Return type:
float - Returns: float : The conditional mutual information between nodeset X and nodeset Y conditionned by nodeset Z
variationOfInformationXY()
Section titled “variationOfInformationXY()”- Return type:
float - Returns: float : The variation of information between nodeset X and nodeset Y