(self, pair_stats)
return out
_pruned_pair_stats converts 'pair_stats' which is a dictionary mapping
            { attr1 -> { attr2 -> {val1 -> {val2 -> count } } } } where
              <val1>: all possible values for attr1
              <val2>: all values for attr2 that appeared at least once with <val1>
              <count>: frequency (# of entities) where attr1: <val1> AND attr2: <val2>

        to a flattened 4-level dictionary { attr1 -> { attr2 -> { val1 -> [pruned list of val2] } } }
        i.e. maps to the co-occurring values for attr2 that exceed
        the self.domain_thresh_1 co-occurrence probability for a given
        attr1-val1 pair.
_pruned_pair_stats converts 'pair_stats' which is a dictionary mapping
            { attr1 -> { attr2 -> {val1 -> {val2 -> count } } } } where
              <val1>: all possible values for attr1
              <val2>: all values for attr2 that appeared at least once with <val1>
              <count>: frequency (# of entities) where attr1: <val1> AND attr2: <val2>
_pruned_pair_stats converts pair_stats which is a dictionary mapping { attr1 - > { attr2 - > { val1 - > { val2 - > count } } } } where <val1 > : all possible values for attr1 <val2 > : all values for attr2 that appeared at least once with <val1 > <count > : frequency ( # of entities ) where attr1 : <val1 > AND attr2 : <val2 >
def _pruned_pair_stats(self, pair_stats):
        """
        _pruned_pair_stats converts 'pair_stats' which is a dictionary mapping
            { attr1 -> { attr2 -> {val1 -> {val2 -> count } } } } where
              <val1>: all possible values for attr1
              <val2>: all values for attr2 that appeared at least once with <val1>
              <count>: frequency (# of entities) where attr1: <val1> AND attr2: <val2>

        to a flattened 4-level dictionary { attr1 -> { attr2 -> { val1 -> [pruned list of val2] } } }
        i.e. maps to the co-occurring values for attr2 that exceed
        the self.domain_thresh_1 co-occurrence probability for a given
        attr1-val1 pair.
        """

        out = {}
        for attr1 in tqdm(pair_stats.keys()):
            out[attr1] = {}
            for attr2 in pair_stats[attr1].keys():
                out[attr1][attr2] = {}
                for val1 in pair_stats[attr1][attr2].keys():
                    denominator = self.single_stats[attr1][val1]
                    # tau becomes a threshhold on co-occurrence frequency
                    # based on the co-occurrence probability threshold
                    # domain_thresh_1.
                    tau = float(self.domain_thresh_1*denominator)
                    top_cands = [val2 for (val2, count) in pair_stats[attr1][attr2][val1].items() if count > tau]
                    out[attr1][attr2][val1] = top_cands
        return out
def _pruned_pair_stats ( self , pair_stats ) : out = { } for attr1 in tqdm ( pair_stats . keys ( ) ) : out [ attr1 ] = { } for attr2 in pair_stats [ attr1 ] . keys ( ) : out [ attr1 ] [ attr2 ] = { } for val1 in pair_stats [ attr1 ] [ attr2 ] . keys ( ) : denominator = self . single_stats [ attr1 ] [ val1 ] # tau becomes a threshhold on co-occurrence frequency # based on the co-occurrence probability threshold # domain_thresh_1. tau = float ( self . domain_thresh_1 * denominator ) top_cands = [ val2 for ( val2 , count ) in pair_stats [ attr1 ] [ attr2 ] [ val1 ] . items ( ) if count > tau ] out [ attr1 ] [ attr2 ] [ val1 ] = top_cands return out