class_docstr: Decision List Classifier
  
  Currently a slight variant of SkopeRules from skope-rules.
  https://github.com/scikit-learn-contrib/skope-rules
docstr: Fits model to provided instances.
  
  Args:
      X: Numpy array for training instances.
      y: Numpy array as training labels.
  
  Returns:
      Itself.
docstr_tok: ["Fits","model","to","provided","instances",".","Args",":","X",":","Numpy","array","for","training","instances",".","y",":","Numpy","array","as","training","labels",".","Returns",":","Itself","."]
code: def fit(self, X, y):
      """Fits model to provided instances.
  
      Args:
          X: Numpy array for training instances.
          y: Numpy array as training labels.
  
      Returns:
          Itself.
      """
      try:
          from skrules import SkopeRules as SR
      except (
          ImportError
      ):  # NOTE: skoperules loves six, shame it's deprecated.
          import six
          import sys
  
          sys.modules["sklearn.externals.six"] = six
          from skrules import SkopeRules as SR
  
      y = clean_dimensions(y, "y")
      if y.ndim != 1:
          msg = "y must be 1 dimensional"
          _log.error(msg)
          raise ValueError(msg)
      if len(y) == 0:
          msg = "y cannot have 0 samples"
          _log.error(msg)
          raise ValueError(msg)
  
      X, n_samples = preclean_X(
          X, self.feature_names, self.feature_types, len(y)
      )
  
      X, self.feature_names_in_, self.feature_types_in_ = unify_data(
          X, n_samples, self.feature_names, self.feature_types, False, 0
      )
  
      y = typify_classification(y)
      # skope-rules handles binary and multiclass classification.
      # It checks this, so we do not need to.
  
      # TODO: it might be cleaner to pass is no feature names, then use mapping property.  That way if they change their names we'll use their new names
  
      # skope-rules seems to want to record things in their names, so replicate their format
      # they seem to have changed this to make rules_ use the given feature_names, but just
      # in case we want to look at any of their other internals, use their naming
      self.feature_index_ = [
          _BASE_FEATURE_NAME + x
          for x in np.arange(len(self.feature_names_in_)).astype(str)
      ]
      self.feature_map_ = {
          key: name
          for key, name in zip(
              self.feature_index_, self.feature_names_in_
          )
      }
      self.sk_model_ = SR(
          feature_names=self.feature_index_, **self.kwargs
      )
  
      self.sk_model_.fit(X, y)
  
      self.classes_ = self.sk_model_.classes_
      class_idx = dict(zip(self.classes_, count()))
      y = np.array([class_idx[el] for el in y], dtype=np.int64)
  
      # TODO: this mean approach is going to fail to be useful for multiclass
      self.pos_ratio_ = np.mean(y)
  
      # Extract rules
      (
          self.internal_rules_,
          self.rules_,
          self.prec_,
          self.recall_,
          self.feat_rule_map_,
      ) = self._extract_rules(self.sk_model_.rules_)
  
      unique_val_counts = np.zeros(
          len(self.feature_names_in_), dtype=np.int64
      )
      for col_idx in range(len(self.feature_names_in_)):
          X_col = X[:, col_idx]
          unique_val_counts.itemset(col_idx, len(np.unique(X_col)))
  
      # TODO: move this call into the explain_global function and extract the information needed
      #       in a cleaner way.  Also, look over the above fields to see if we can simplify
      self.global_selector_ = gen_global_selector(
          len(self.feature_names_in_),
          self.feature_names_in_,
          self.feature_types_in_,
          unique_val_counts,
          None,
      )
  
      self.n_features_in_ = len(self.feature_names_in_)
  
      self.has_fitted_ = True
  
      return self
  
imports: from itertools import count
  from sklearn.base import ClassifierMixin
  from sklearn.utils.validation import check_is_fitted
  from ..api.base import ExplainerMixin, ExplanationMixin
  from ..utils._explanation import gen_name_from_class, gen_global_selector, gen_local_selector, gen_perf_dicts
  from copy import deepcopy
  import numpy
  import pandas
  import re
  from ..utils._clean_x import preclean_X
  from ..utils._clean_simple import clean_dimensions, typify_classification
  from ..utils._unify_data import unify_data
  import logging
label_desc: Use image node_id 2 for calling the DecisionListClassifier obj's underlying member method code with example usage: obj.fit(X, y) and returns: self