class_docstr: Sequential Feature Selection for Classification and Regression.
  
  Parameters
  ----------
  estimator : scikit-learn classifier or regressor
  k_features : int or tuple or str (default: 1)
      Number of features to select,
      where k_features < the full feature set.
      New in 0.4.2: A tuple containing a min and max value can be provided,
          and the SFS will consider return any feature combination between
          min and max that scored highest in cross-validation. For example,
          the tuple (1, 4) will return any combination from
          1 up to 4 features instead of a fixed number of features k.
      New in 0.8.0: A string argument "best" or "parsimonious".
          If "best" is provided, the feature selector will return the
          feature subset with the best cross-validation performance.
          If "parsimonious" is provided as an argument, the smallest
          feature subset that is within one standard error of the
          cross-validation performance will be selected.
  
  forward : bool (default: True)
      Forward selection if True,
      backward selection otherwise
  
  floating : bool (default: False)
      Adds a conditional exclusion/inclusion if True.
  
  verbose : int (default: 0), level of verbosity to use in logging.
      If 0, no output,
      if 1 number of features in current set, if 2 detailed logging i
      ncluding timestamp and cv scores at step.
  
  scoring : str, callable, or None (default: None)
      If None (default), uses 'accuracy' for sklearn classifiers
      and 'r2' for sklearn regressors.
      If str, uses a sklearn scoring metric string identifier, for example
      {accuracy, f1, precision, recall, roc_auc} for classifiers,
      {'mean_absolute_error', 'mean_squared_error'/'neg_mean_squared_error',
      'median_absolute_error', 'r2'} for regressors.
      If a callable object or function is provided, it has to be conform with
      sklearn's signature ``scorer(estimator, X, y)``; see
      https://scikit-learn.org/stable/modules/generated/sklearn.metrics.make_scorer.html
      for more information.
  
  cv : int (default: 5)
      Integer or iterable yielding train, test splits. If cv is an integer
      and `estimator` is a classifier (or y consists of integer class
      labels) stratified k-fold. Otherwise regular k-fold cross-validation
      is performed. No cross-validation if cv is None, False, or 0.
  
  n_jobs : int (default: 1)
      The number of CPUs to use for evaluating different feature subsets
      in parallel. -1 means 'all CPUs'.
  
  pre_dispatch : int, or string (default: '2*n_jobs')
      Controls the number of jobs that get dispatched
      during parallel execution if `n_jobs > 1` or `n_jobs=-1`.
      Reducing this number can be useful to avoid an explosion of
      memory consumption when more jobs get dispatched than CPUs can process.
      This parameter can be:
      None, in which case all the jobs are immediately created and spawned.
          Use this for lightweight and fast-running jobs,
          to avoid delays due to on-demand spawning of the jobs
      An int, giving the exact number of total jobs that are spawned
      A string, giving an expression as a function
          of n_jobs, as in `2*n_jobs`
  
  clone_estimator : bool (default: True)
      Clones estimator if True; works with the original estimator instance
      if False. Set to False if the estimator doesn't
      implement scikit-learn's set_params and get_params methods.
      In addition, it is required to set cv=0, and n_jobs=1.
  
  fixed_features : tuple (default: None)
      If not `None`, the feature indices provided as a tuple will be
      regarded as fixed by the feature selector. For example, if
      `fixed_features=(1, 3, 7)`, the 2nd, 4th, and 8th feature are
      guaranteed to be present in the solution. Note that if
      `fixed_features` is not `None`, make sure that the number of
      features to be selected is greater than `len(fixed_features)`.
      In other words, ensure that `k_features > len(fixed_features)`.
      New in mlxtend v. 0.18.0.
  
  feature_groups : list or None (default: None)
      Optional argument for treating certain features as a group.
      This means, the features within a group are always selected together,
      never split.
      For example, `feature_groups=[[1], [2], [3, 4, 5]]`
      specifies 3 feature groups. In this case,
      possible feature selection results with `k_features=2`
      are `[[1], [2]`, `[[1], [3, 4, 5]]`, or `[[2], [3, 4, 5]]`.
      Feature groups can be useful for
      interpretability, for example, if features 3, 4, 5 are one-hot
      encoded features.  (For  more details, please read the notes at the
      bottom of this docstring).  New in mlxtend v. 0.21.0.
  
  Attributes
  ----------
  k_feature_idx_ : array-like, shape = [n_predictions]
      Feature Indices of the selected feature subsets.
  
  k_feature_names_ : array-like, shape = [n_predictions]
      Feature names of the selected feature subsets. If pandas
      DataFrames are used in the `fit` method, the feature
      names correspond to the column names. Otherwise, the
      feature names are string representation of the feature
      array indices. New in v 0.13.0.
  
  k_score_ : float
      Cross validation average score of the selected subset.
  
  subsets_ : dict
      A dictionary of selected feature subsets during the
      sequential selection, where the dictionary keys are
      the lengths k of these feature subsets. If the parameter
      `feature_groups` is not None, the value of key indicates
      the number of groups that are selected together. The dictionary
      values are dictionaries themselves with the following
      keys: 'feature_idx' (tuple of indices of the feature subset)
            'feature_names' (tuple of feature names of the feat. subset)
            'cv_scores' (list individual cross-validation scores)
            'avg_score' (average cross-validation score)
      Note that if pandas
      DataFrames are used in the `fit` method, the 'feature_names'
      correspond to the column names. Otherwise, the
      feature names are string representation of the feature
      array indices. The 'feature_names' is new in v 0.13.0.
  
  Notes
  -----
  (1) If parameter `feature_groups` is not None, the
  number of features is equal to the number of feature groups, i.e.
  `len(feature_groups)`. For  example, if `feature_groups = [[0], [1], [2, 3],
  [4]]`, then the `max_features` value cannot exceed 4.
  
  (2) Although two or more individual features may be considered as one group
  throughout the feature-selection process, it does not mean the individual
  features of that group have the same impact on the outcome. For instance, in
  linear regression, the coefficient of the feature 2 and 3 can be different
  even if they are considered as one group in feature_groups.
  
  (3) If both fixed_features and feature_groups are specified, ensure that each
  feature group contains the fixed_features selection. E.g., for a 3-feature set
  fixed_features=[0, 1] and feature_groups=[[0, 1], [2]] is valid;
  fixed_features=[0, 1] and feature_groups=[[0], [1, 2]] is not valid.
  
  (4) In case of KeyboardInterrupt, the dictionary subsets may not be completed.
  If user is still interested in getting the best score, they can use method
  `finalize_fit`.
  
  Examples
  -----------
  For usage examples, please see
  https://rasbt.github.io/mlxtend/user_guide/feature_selection/SequentialFeatureSelector/
code: def __init__(
      self,
      estimator,
      k_features=1,
      forward=True,
      floating=False,
      verbose=0,
      scoring=None,
      cv=5,
      n_jobs=1,
      pre_dispatch="2*n_jobs",
      clone_estimator=True,
      fixed_features=None,
      feature_groups=None,
  ):
      self.estimator = estimator
      self.k_features = k_features
      self.forward = forward
      self.floating = floating
      self.pre_dispatch = pre_dispatch
      # Want to raise meaningful error message if a
      # cross-validation generator is inputted
      if isinstance(cv, types.GeneratorType):
          err_msg = (
              "Input cv is a generator object, which is not "
              "supported. Instead please input an iterable yielding "
              "train, test splits. This can usually be done by "
              "passing a cross-validation generator to the "
              "built-in list function. I.e. cv=list(<cv-generator>)"
          )
          raise TypeError(err_msg)
      self.cv = cv
      self.n_jobs = n_jobs
      self.verbose = verbose
  
      self.clone_estimator = clone_estimator
      if self.clone_estimator:
          self.est_ = clone(self.estimator)
      else:
          self.est_ = self.estimator
  
      self.scoring = scoring
      if self.scoring is None:
          if not hasattr(self.est_, "_estimator_type"):
              raise AttributeError(
                  "Estimator must have an ._estimator_type for infering `scoring`"
              )
  
          if self.est_._estimator_type == "classifier":
              self.scoring = "accuracy"
          elif self.est_._estimator_type == "regressor":
              self.scoring = "r2"
          else:
              raise AttributeError(
                  "Estimator must be a Classifier or Regressor."
              )
  
      if isinstance(self.scoring, str):
          self.scorer = get_scorer(self.scoring)
      else:
          self.scorer = self.scoring
  
      self.fixed_features = fixed_features
      self.feature_groups = feature_groups
  
      self.fitted = False
      self.interrupted_ = False
  
      # don't mess with this unless testing
      self._TESTING_INTERRUPT_MODE = False
  
imports: import datetime
  import sys
  import types
  from copy import deepcopy
  from itertools import combinations
  import numpy
  import scipy
  import scipy.stats
  from joblib import Parallel, delayed
  from sklearn.base import MetaEstimatorMixin, clone
  from sklearn.metrics import get_scorer
  from ..externals.name_estimators import _name_estimators
  from ..utils.base_compostion import _BaseXComposition
  from .utilities import _calc_score, _get_featurenames, _merge_lists, _preprocess
label_desc: Use image node_id 1 to create a new SequentialFeatureSelector object from inherited base classes: _BaseXComposition, MetaEstimatorMixin with example: obj = SequentialFeatureSelector(estimator, k_features, forward, floating, verbose, scoring, cv, n_jobs, pre_dispatch, clone_estimator, fixed_features, feature_groups)