(self)
collect_stats memoizes:
          1. self.single_attr_stats ({ attribute -> { value -> count } })
            the frequency (# of entities) of a given attribute-value
          2. self.pair_attr_stats ({ attr1 -> { attr2 -> {val1 -> {val2 -> count } } } })
            where DataFrame contains 3 columns:
              <attr1>: all possible values for attr1 ('val1')
              <attr2>: all values for attr2 that appeared at least once with <val1> ('val2')
              <count>: frequency (# of entities) where attr1: val1 AND attr2: val2
            Also known as co-occurrence count.
collect_stats memoizes:
          1. self.single_attr_stats ({ attribute -> { value -> count } })
            the frequency (# of entities) of a given attribute-value
          2. self.pair_attr_stats ({ attr1 -> { attr2 -> {val1 -> {val2 -> count } } } })
            where DataFrame contains 3 columns:
              <attr1>: all possible values for attr1 ('val1')
              <attr2>: all values for attr2 that appeared at least once with <val1> ('val2')
              <count>: frequency (# of entities) where attr1: val1 AND attr2: val2
            Also known as co-occurrence count.
collect_stats memoizes : 1 . self . single_attr_stats ( { attribute - > { value - > count } } ) the frequency ( # of entities ) of a given attribute - value 2 . self . pair_attr_stats ( { attr1 - > { attr2 - > { val1 - > { val2 - > count } } } } ) where DataFrame contains 3 columns : <attr1 > : all possible values for attr1 ( val1 ) <attr2 > : all values for attr2 that appeared at least once with <val1 > ( val2 ) <count > : frequency ( # of entities ) where attr1 : val1 AND attr2 : val2 Also known as co - occurrence count .
def collect_stats(self):
        """
        collect_stats memoizes:
          1. self.single_attr_stats ({ attribute -> { value -> count } })
            the frequency (# of entities) of a given attribute-value
          2. self.pair_attr_stats ({ attr1 -> { attr2 -> {val1 -> {val2 -> count } } } })
            where DataFrame contains 3 columns:
              <attr1>: all possible values for attr1 ('val1')
              <attr2>: all values for attr2 that appeared at least once with <val1> ('val2')
              <count>: frequency (# of entities) where attr1: val1 AND attr2: val2
            Also known as co-occurrence count.
        """
        logging.debug("Collecting single/pair-wise statistics...")
        self.total_tuples = self.get_raw_data().shape[0]
        # Single attribute-value frequency.
        for attr in self.get_attributes():
            self.single_attr_stats[attr] = self.get_stats_single(attr)
        # Compute co-occurrence frequencies.
        for cond_attr in self.get_attributes():
            self.pair_attr_stats[cond_attr] = {}
            for trg_attr in self.get_attributes():
                if trg_attr != cond_attr:
                    self.pair_attr_stats[cond_attr][trg_attr] = self.get_stats_pair(cond_attr, trg_attr)
def collect_stats ( self ) : logging . debug ( "Collecting single/pair-wise statistics..." ) self . total_tuples = self . get_raw_data ( ) . shape [ 0 ] # Single attribute-value frequency. for attr in self . get_attributes ( ) : self . single_attr_stats [ attr ] = self . get_stats_single ( attr ) # Compute co-occurrence frequencies. for cond_attr in self . get_attributes ( ) : self . pair_attr_stats [ cond_attr ] = { } for trg_attr in self . get_attributes ( ) : if trg_attr != cond_attr : self . pair_attr_stats [ cond_attr ] [ trg_attr ] = self . get_stats_pair ( cond_attr , trg_attr )