(self, attr, row)
return init_value, init_value_idx, domain_lst
get_domain_cell returns a list of all domain values for the given
        entity (row) and attribute. The domain never has null as a possible value.

        We define domain values as values in 'attr' that co-occur with values
        in attributes ('cond_attr') that are correlated with 'attr' at least in
        magnitude of self.cor_strength (init parameter).

        For example:

                cond_attr       |   attr
                H                   B                   <-- current row
                H                   C
                I                   D
                H                   E

        This would produce [B,C,E] as domain values.

        :return: (initial value of entity-attribute, domain values for entity-attribute).
get_domain_cell returns a list of all domain values for the given
        entity (row) and attribute. The domain never has null as a possible value.
get_domain_cell returns a list of all domain values for the given entity ( row ) and attribute . The domain never has null as a possible value .
def get_domain_cell(self, attr, row):
        """
        get_domain_cell returns a list of all domain values for the given
        entity (row) and attribute. The domain never has null as a possible value.

        We define domain values as values in 'attr' that co-occur with values
        in attributes ('cond_attr') that are correlated with 'attr' at least in
        magnitude of self.cor_strength (init parameter).

        For example:

                cond_attr       |   attr
                H                   B                   <-- current row
                H                   C
                I                   D
                H                   E

        This would produce [B,C,E] as domain values.

        :return: (initial value of entity-attribute, domain values for entity-attribute).
        """

        domain = set()
        init_value = row[attr]
        correlated_attributes = self.get_corr_attributes(attr, self.cor_strength)
        # Iterate through all correlated attributes and take the top K co-occurrence values
        # for 'attr' with the current row's 'cond_attr' value.
        for cond_attr in correlated_attributes:
            # Ignore correlations with index, tuple id or the same attribute.
            if cond_attr == attr or cond_attr == '_tid_':
                continue
            if not self.pair_stats[cond_attr][attr]:
                logging.warning("domain generation could not find pair_statistics between attributes: {}, {}".format(cond_attr, attr))
                continue
            cond_val = row[cond_attr]
            # Ignore co-occurrence with a NULL cond init value since we do not
            # store them.
            # Also it does not make sense to retrieve the top co-occuring
            # values with a NULL value.
            # It is possible for cond_val to not be in pair stats if it only co-occurs
            # with NULL values.
            if cond_val == NULL_REPR or cond_val not in self.pair_stats[cond_attr][attr]:
                continue

            # Update domain with top co-occuring values with the cond init value.
            candidates = self.pair_stats[cond_attr][attr][cond_val]
            domain.update(candidates)

        # We should not have any NULLs since we do not store co-occurring NULL
        # values.
        assert NULL_REPR not in domain

        # Add the initial value to the domain if it is not NULL.
        if init_value != NULL_REPR:
            domain.add(init_value)

        # Convert to ordered list to preserve order.
        domain_lst = sorted(list(domain))

        # Get the index of the initial value.
        # NULL values are not in the domain so we set their index to -1.
        init_value_idx = -1
        if init_value != NULL_REPR:
            init_value_idx = domain_lst.index(init_value)

        return init_value, init_value_idx, domain_lst
def get_domain_cell ( self , attr , row ) : domain = set ( ) init_value = row [ attr ] correlated_attributes = self . get_corr_attributes ( attr , self . cor_strength ) # Iterate through all correlated attributes and take the top K co-occurrence values # for 'attr' with the current row's 'cond_attr' value. for cond_attr in correlated_attributes : # Ignore correlations with index, tuple id or the same attribute. if cond_attr == attr or cond_attr == '_tid_' : continue if not self . pair_stats [ cond_attr ] [ attr ] : logging . warning ( "domain generation could not find pair_statistics between attributes: {}, {}" . format ( cond_attr , attr ) ) continue cond_val = row [ cond_attr ] # Ignore co-occurrence with a NULL cond init value since we do not # store them. # Also it does not make sense to retrieve the top co-occuring # values with a NULL value. # It is possible for cond_val to not be in pair stats if it only co-occurs # with NULL values. if cond_val == NULL_REPR or cond_val not in self . pair_stats [ cond_attr ] [ attr ] : continue # Update domain with top co-occuring values with the cond init value. candidates = self . pair_stats [ cond_attr ] [ attr ] [ cond_val ] domain . update ( candidates ) # We should not have any NULLs since we do not store co-occurring NULL # values. assert NULL_REPR not in domain # Add the initial value to the domain if it is not NULL. if init_value != NULL_REPR : domain . add ( init_value ) # Convert to ordered list to preserve order. domain_lst = sorted ( list ( domain ) ) # Get the index of the initial value. # NULL values are not in the domain so we set their index to -1. init_value_idx = - 1 if init_value != NULL_REPR : init_value_idx = domain_lst . index ( init_value ) return init_value , init_value_idx , domain_lst