(self, state)
Iterate through all combinations of attributes as ordered by Relief,
        starting with a single attribute if Mosaic is colored by class
        distributions, and two if by Pearson.
Iterate through all combinations of attributes as ordered by Relief,
        starting with a single attribute if Mosaic is colored by class
        distributions, and two if by Pearson.
Iterate through all combinations of attributes as ordered by Relief starting with a single attribute if Mosaic is colored by class distributions and two if by Pearson .
def iterate_states(self, state):
        """
        Iterate through all combinations of attributes as ordered by Relief,
        starting with a single attribute if Mosaic is colored by class
        distributions, and two if by Pearson.
        """
        # If we put initialization of `self.attrs` to `initialize`,
        # `score_heuristic` would be run on every call to master's `set_data`.
        master = self.master
        data = master.discrete_data
        min_attrs, max_attrs = self.attr_range()
        if min_attrs > max_attrs:
            return
        if state is None:  # on the first call, compute order
            if self._compute_class_dists():
                self.marginal = get_distribution(data, data.domain.class_var)
                self.marginal.normalize()
                state = list(range(min_attrs))
            else:
                self.marginal = get_distributions(data)
                for dist in self.marginal:
                    dist.normalize()
                state = list(range(min_attrs))
        n_attrs = len(data.domain.attributes)
        while True:
            yield state
            # Reset while running; just abort
            if self.attr_ordering is None:
                break
            for up, _ in enumerate(state):
                state[up] += 1
                if up + 1 == len(state) or state[up] < state[up + 1]:
                    break
                state[up] = up
            if state[-1] == len(self.attr_ordering):
                if len(state) < min(max_attrs, n_attrs):
                    state = list(range(len(state) + 1))
                else:
                    break
def iterate_states ( self , state ) : # If we put initialization of `self.attrs` to `initialize`, # `score_heuristic` would be run on every call to master's `set_data`. master = self . master data = master . discrete_data min_attrs , max_attrs = self . attr_range ( ) if min_attrs > max_attrs : return if state is None : # on the first call, compute order if self . _compute_class_dists ( ) : self . marginal = get_distribution ( data , data . domain . class_var ) self . marginal . normalize ( ) state = list ( range ( min_attrs ) ) else : self . marginal = get_distributions ( data ) for dist in self . marginal : dist . normalize ( ) state = list ( range ( min_attrs ) ) n_attrs = len ( data . domain . attributes ) while True : yield state # Reset while running; just abort if self . attr_ordering is None : break for up , _ in enumerate ( state ) : state [ up ] += 1 if up + 1 == len ( state ) or state [ up ] < state [ up + 1 ] : break state [ up ] = up if state [ - 1 ] == len ( self . attr_ordering ) : if len ( state ) < min ( max_attrs , n_attrs ) : state = list ( range ( len ( state ) + 1 ) ) else : break