class_docstr: Dataset for LOFO
  Parameters
  ----------
  df: pandas dataframe
  target: string
      Column name for target within df
  features: list of strings
      List of column names within df
  feature_groups: dict, optional
      Name, value dictionary of feature groups as numpy.darray or scipy.csr.scr_matrix
  auto_group_threshold: float, optional
      Threshold for grouping correlated features together, must be between 0 and 1
code: def __init__(
      self,
      df,
      target,
      features,
      feature_groups=None,
      auto_group_threshold=1.0,
  ):
      self.df = df.copy()
      self.features = list(features)
      self.feature_groups = feature_groups if feature_groups else dict()
  
      self.num_rows = df.shape[0]
      self.target_name = target
      self.y = df[self.target_name].values
  
      grouped_features, auto_groups = self.auto_group_features(
          auto_group_threshold
      )
      self.features = [
          [f] for f in list(set(self.features) - set(grouped_features))
      ] + auto_groups
      self.feature_names = [
          " & ".join(feature_list) for feature_list in self.features
      ]
  
      if len(auto_groups) > 0:
          print("Automatically grouped features by correlation:")
          for i in range(len(auto_groups)):
              print(i + 1, auto_groups[i])
  
      for feature_name, feature_matrix in self.feature_groups.items():
          if not (
              isinstance(feature_matrix, np.ndarray)
              or isinstance(feature_matrix, ss.csr.csr_matrix)
          ):
              raise Exception(
                  "Data type {dtype} is not a valid type!".format(
                      dtype=type(feature_matrix)
                  )
              )
  
          if feature_matrix.shape[0] != self.num_rows:
              raise Exception(
                  "Expected {expected} rows but got {n} rows!".format(
                      expected=self.num_rows, n=feature_matrix.shape[0]
                  )
              )
  
          if feature_name in self.feature_names:
              same_name_exception = "Feature group name '{name}' is the same with one of the features!"
              raise Exception(
                  same_name_exception.format(name=feature_name)
              )
  
file_path: lofo-importance/lofo/dataset.py
imports: import itertools
  import numpy
  import scipy.sparse
  from scipy.stats import spearmanr
  from lofo.utils import flatten_list
  import networkx
label_desc: Use image node_id 1 to create a new Dataset object  with example: obj = Dataset(df, target, features, feature_groups, auto_group_threshold)