class_docstr: An estimator that supports building rules as described in
  A Simple, Fast, and Effective Rule Learner (1999). Intended to be used
  as part of the SlipperRulesClassifier.
class_docstr_tok: ["An","estimator","that","supports","building","rules","as","described","in","A","Simple",",","Fast",",","and","Effective","Rule","Learner","(","1999",")",".","Intended","to","be","used","as","part","of","the","SlipperRulesClassifier","."]
docstr: Main loop for training
docstr_tok: ["Main","loop","for","training"]
code: def fit(self, X, y, sample_weight=None, feature_names=None):
      """
      Main loop for training
      """
      X, y, feature_names = check_fit_arguments(
          self, X, y, feature_names
      )
      if sample_weight is not None:
          self.D = sample_weight
  
      X_grow, X_prune, y_grow, y_prune = train_test_split(
          X, y, test_size=0.33
      )
  
      self._make_feature_dict(X.shape[1], feature_names)
  
      rule = self._grow_rule(X_grow, y_grow)
      rule = self._prune_rule(X_prune, y_prune, rule)
      self._set_rule_or_default(X, y, rule)
  
      return self
  
imports: import random
  import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.model_selection import train_test_split
  from imodels.util.arguments import check_fit_arguments
label_desc: Use image node_id 18 for calling the SlipperBaseEstimator obj's underlying member method code with example usage: obj.fit(X, y, sample_weight, feature_names) and returns: self