class_docstr: Wraps scikitlearn classifiers.
  
  Parameters
  ----------
  strategy : str, default = "LightGBM"
      The choice for the classifier.
      Available strategies = {"LightGBM", "RandomForest", "ExtraTrees",
      "Tree", "Bagging", "AdaBoost" or "Linear"}.
  
  **params : default = None
      Parameters of the corresponding classifier.
      Examples : n_estimators, max_depth...
class_docstr_tok: ["Wraps","scikitlearn","classifiers",".","Parameters","--","--","--","--","--","strategy",":","str",",","default","=","``","LightGBM","''","The","choice","for","the","classifier",".","Available","strategies","=","{","``","LightGBM","''",",","``","RandomForest","''",",","``","ExtraTrees","''",",","``","Tree","''",",","``","Bagging","''",",","``","AdaBoost","''","or","``","Linear","''","}",".","*","*","params",":","default","=","None","Parameters","of","the","corresponding","classifier",".","Examples",":","n_estimators",",","max_depth","..."]
docstr: Compute feature importances.
  
  Classifier must be fitted before.
  
  Returns
  -------
  dict
      Dictionnary containing a measure of feature importance (value) for
      each feature (key).
docstr_tok: ["Compute","feature","importances",".","Classifier","must","be","fitted","before",".","Returns","--","--","--","-","dict","Dictionnary","containing","a","measure","of","feature","importance","(","value",")","for","each","feature","(","key",")","."]
code: def feature_importances(self):
      """Compute feature importances.
  
      Classifier must be fitted before.
  
      Returns
      -------
      dict
          Dictionnary containing a measure of feature importance (value) for
          each feature (key).
  
      """
      if self.__fitOK:
          if self.get_params()["strategy"] in ["Linear"]:
              importance = {}
              f = np.mean(np.abs(self.get_estimator().coef_), axis=0)
  
              for i, col in enumerate(self.__col):
                  importance[col] = f[i]
  
          elif self.get_params()["strategy"] in [
              "LightGBM",
              "RandomForest",
              "ExtraTrees",
              "Tree",
          ]:
              importance = {}
              f = self.get_estimator().feature_importances_
  
              for i, col in enumerate(self.__col):
                  importance[col] = f[i]
  
          elif self.get_params()["strategy"] in ["AdaBoost"]:
              importance = {}
              norm = self.get_estimator().estimator_weights_.sum()
  
              try:
                  # LGB, RF, ET, Tree and AdaBoost
                  f = (
                      sum(
                          weight * est.feature_importances_
                          for weight, est in zip(
                              self.get_estimator().estimator_weights_,
                              self.get_estimator().estimators_,
                          )
                      )
                      / norm
                  )  # noqa
  
              except:  # noqa
                  # Linear
                  f = (
                      sum(
                          weight * np.mean(np.abs(est.coef_), axis=0)
                          for weight, est in zip(
                              self.get_estimator().estimator_weights_,
                              self.get_estimator().estimators_,
                          )
                      )
                      / norm
                  )  # noqa
  
              for i, col in enumerate(self.__col):
                  importance[col] = f[i]
  
          elif self.get_params()["strategy"] in ["Bagging"]:
              importance = {}
              importance_bag = []
  
              for i, b in enumerate(self.get_estimator().estimators_):
                  d = {}
  
                  try:
                      # LGB, RF, ET, Tree and AdaBoost
                      f = b.feature_importances_
                  except:  # noqa
                      # Linear
                      f = np.mean(np.abs(b.coef_), axis=0)
  
                  for j, c in enumerate(
                      self.get_estimator().estimators_features_[i]
                  ):  # noqa
                      d[self.__col[c]] = f[j]
  
                  importance_bag.append(d.copy())
  
              for i, col in enumerate(self.__col):
                  list_filtered = filter(
                      lambda x: x != 0,
                      [
                          k[col] if col in k else 0
                          for k in importance_bag
                      ],
                  )
                  importance[col] = np.mean(list(list_filtered))  # noqa
  
          else:
              importance = {}
  
          return importance
  
      else:
          raise ValueError("You must call the fit function before !")
  
imports: import warnings
  from copy import copy
  import numpy
  import pandas
  from sklearn.ensemble import AdaBoostClassifier, BaggingClassifier, ExtraTreesClassifier, RandomForestClassifier
  from sklearn.linear_model import LogisticRegression
  from sklearn.tree import DecisionTreeClassifier
  from lightgbm import LGBMClassifier
label_desc: Use image node_id 6 for calling the Classifier obj's underlying member method code with example usage: obj.feature_importances() and returns: importance