class_docstr: Simply returns the global gain/gini feature importances for tree models.
  
  This is only for benchmark comparisons and is not meant to approximate SHAP values.
class_docstr_tok: ["Simply","returns","the","global","gain\/gini","feature","importances","for","tree","models",".","This","is","only","for","benchmark","comparisons","and","is","not","meant","to","approximate","SHAP","values","."]
code: def __init__(self, model):
      if str(type(model)).endswith(
          "sklearn.tree.tree.DecisionTreeRegressor'>"
      ):
          pass
      elif str(type(model)).endswith(
          "sklearn.tree.tree.DecisionTreeClassifier'>"
      ):
          pass
      elif str(type(model)).endswith(
          "sklearn.ensemble.forest.RandomForestRegressor'>"
      ):
          pass
      elif str(type(model)).endswith(
          "sklearn.ensemble.forest.RandomForestClassifier'>"
      ):
          pass
      elif str(type(model)).endswith("xgboost.sklearn.XGBRegressor'>"):
          pass
      elif str(type(model)).endswith("xgboost.sklearn.XGBClassifier'>"):
          pass
      else:
          raise NotImplementedError(
              "The passed model is not yet supported by TreeGainExplainer: "
              + str(type(model))
          )
      assert hasattr(
          model, "feature_importances_"
      ), "The passed model does not have a feature_importances_ attribute!"
      self.model = model
  
imports: import numpy
  from .._explainer import Explainer
label_desc: Use image node_id 1 to create a new TreeGain object from inherited base classes: Explainer with example: obj = TreeGain(model)