'Apply data and target class to a rule.
Parameters
X, Y, W : ndarray
Learning data.
target_class : int
Index of the class to model.
predef_covered : ndarray
Built-in optimisation variable to enable external
computation of covered examples.'

def filter_and_store(self, X, Y, W, target_class, predef_covered=None):

    self.target_class = target_class
    if (predef_covered is not None):
        self.covered_examples = predef_covered
    else:
        self.covered_examples = np.ones(X.shape[0], dtype=bool)
        for selector in self.selectors:
            self.covered_examples &= selector.filter_data(X)
    self.curr_class_dist = get_dist(Y[self.covered_examples], (W[self.covered_examples] if (W is not None) else None), self.domain)
