class_docstr: Displays the most informative features in a model by showing a bar chart
  of features ranked by their importances. Although primarily a feature
  engineering mechanism, this visualizer requires a model that has either a
  ``coef_`` or ``feature_importances_`` parameter after fit.
  
  Note: Some classification models such as ``LogisticRegression``, return
  ``coef_`` as a multidimensional array of shape ``(n_classes, n_features)``.
  In this case, the ``FeatureImportances`` visualizer computes the mean of the
  ``coefs_`` by class for each feature.
  
  Parameters
  ----------
  estimator : Estimator
      A Scikit-Learn estimator that learns feature importances. Must support
      either ``coef_`` or ``feature_importances_`` parameters. If the estimator
      is not fitted, it is fit when the visualizer is fitted, unless otherwise
      specified by ``is_fitted``.
  
  ax : matplotlib Axes, default: None
      The axis to plot the figure on. If None is passed in the current axes
      will be used (or generated if required).
  
  labels : list, default: None
      A list of feature names to use. If a DataFrame is passed to fit and
      features is None, feature names are selected as the column names.
  
  relative : bool, default: True
      If true, the features are described by their relative importance as a
      percentage of the strongest feature component; otherwise the raw
      numeric description of the feature importance is shown.
  
  absolute : bool, default: False
      Make all coeficients absolute to more easily compare negative
      coefficients with positive ones.
  
  xlabel : str, default: None
      The label for the X-axis. If None is automatically determined by the
      underlying model and options provided.
  
  stack : bool, default: False
      If true and the classifier returns multi-class feature importance,
      then a stacked bar plot is plotted; otherwise the mean of the
      feature importance across classes are plotted.
  
  colors: list of strings
      Specify colors for each bar in the chart if ``stack==False``.
  
  colormap : string or matplotlib cmap
      Specify a colormap to color the classes if ``stack==True``.
  
  is_fitted : bool or str, default='auto'
      Specify if the wrapped estimator is already fitted. If False, the estimator
      will be fit when the visualizer is fit, otherwise, the estimator will not be
      modified. If 'auto' (default), a helper method will check if the estimator
      is fitted before fitting it again.
  
  topn : int, default=None
      Display only the top N results with a positive integer, or the bottom N
      results with a negative integer. If None or 0, all results are shown.
  
  kwargs : dict
      Keyword arguments that are passed to the base class and may influence
      the visualization as defined in other Visualizers.
  
  Attributes
  ----------
  features_ : np.array
      The feature labels ranked according to their importance
  
  feature_importances_ : np.array
      The numeric value of the feature importance computed by the model
  
  classes_ : np.array
      The classes labeled. Is not None only for classifier.
  
  Examples
  --------
  
  >>> from sklearn.ensemble import GradientBoostingClassifier
  >>> visualizer = FeatureImportances(GradientBoostingClassifier())
  >>> visualizer.fit(X, y)
  >>> visualizer.show()
class_docstr_tok: ["Displays","the","most","informative","features","in","a","model","by","showing","a","bar","chart","of","features","ranked","by","their","importances",".","Although","primarily","a","feature","engineering","mechanism",",","this","visualizer","requires","a","model","that","has","either","a","``","coef_","``","or","``","feature_importances_","``","parameter","after","fit",".","Note",":","Some","classification","models","such","as","``","LogisticRegression","``",",","return","``","coef_","``","as","a","multidimensional","array","of","shape","``","(","n_classes",",","n_features",")","``",".","In","this","case",",","the","``","FeatureImportances","``","visualizer","computes","the","mean","of","the","``","coefs_","``","by","class","for","each","feature",".","Parameters","--","--","--","--","--","estimator",":","Estimator","A","Scikit-Learn","estimator","that","learns","feature","importances",".","Must","support","either","``","coef_","``","or","``","feature_importances_","``","parameters",".","If","the","estimator","is","not","fitted",",","it","is","fit","when","the","visualizer","is","fitted",",","unless","otherwise","specified","by","``","is_fitted","``",".","ax",":","matplotlib","Axes",",","default",":","None","The","axis","to","plot","the","figure","on",".","If","None","is","passed","in","the","current","axes","will","be","used","(","or","generated","if","required",")",".","labels",":","list",",","default",":","None","A","list","of","feature","names","to","use",".","If","a","DataFrame","is","passed","to","fit","and","features","is","None",",","feature","names","are","selected","as","the","column","names",".","relative",":","bool",",","default",":","True","If","true",",","the","features","are","described","by","their","relative","importance","as","a","percentage","of","the","strongest","feature","component",";","otherwise","the","raw","numeric","description","of","the","feature","importance","is","shown",".","absolute",":","bool",",","default",":","False","Make","all","coeficients","absolute","to","more","easily","compare","negative","coefficients","with","positive","ones",".","xlabel",":","str",",","default",":","None","The","label","for","the","X-axis",".","If","None","is","automatically","determined","by","the","underlying","model","and","options","provided",".","stack",":","bool",",","default",":","False","If","true","and","the","classifier","returns","multi-class","feature","importance",",","then","a","stacked","bar","plot","is","plotted",";","otherwise","the","mean","of","the","feature","importance","across","classes","are","plotted",".","colors",":","list","of","strings","Specify","colors","for","each","bar","in","the","chart","if","``","stack==False","``",".","colormap",":","string","or","matplotlib","cmap","Specify","a","colormap","to","color","the","classes","if","``","stack==True","``",".","is_fitted",":","bool","or","str",",","default='auto'","Specify","if","the","wrapped","estimator","is","already","fitted",".","If","False",",","the","estimator","will","be","fit","when","the","visualizer","is","fit",",","otherwise",",","the","estimator","will","not","be","modified",".","If","'auto","'","(","default",")",",","a","helper","method","will","check","if","the","estimator","is","fitted","before","fitting","it","again",".","topn",":","int",",","default=None","Display","only","the","top","N","results","with","a","positive","integer",",","or","the","bottom","N","results","with","a","negative","integer",".","If","None","or","0",",","all","results","are","shown",".","kwargs",":","dict","Keyword","arguments","that","are","passed","to","the","base","class","and","may","influence","the","visualization","as","defined","in","other","Visualizers",".","Attributes","--","--","--","--","--","features_",":","np.array","The","feature","labels","ranked","according","to","their","importance","feature_importances_",":","np.array","The","numeric","value","of","the","feature","importance","computed","by","the","model","classes_",":","np.array","The","classes","labeled",".","Is","not","None","only","for","classifier",".","Examples","--","--","--","--",">",">",">","from","sklearn.ensemble","import","GradientBoostingClassifier",">",">",">","visualizer","=","FeatureImportances","(","GradientBoostingClassifier","(",")",")",">",">",">","visualizer.fit","(","X",",","y",")",">",">",">","visualizer.show","(",")"]
code: def __init__(
      self,
      estimator,
      ax=None,
      labels=None,
      relative=True,
      absolute=False,
      xlabel=None,
      stack=False,
      colors=None,
      colormap=None,
      is_fitted="auto",
      topn=None,
      **kwargs,
  ):
      # Initialize the visualizer bases
      super(FeatureImportances, self).__init__(
          estimator, ax=ax, is_fitted=is_fitted, **kwargs
      )
  
      # Data Parameters
      self.labels = labels
      self.relative = relative
      self.absolute = absolute
      self.xlabel = xlabel
      self.stack = stack
      self.colors = colors
      self.colormap = colormap
      self.topn = topn
  
imports: import warnings
  import numpy
  from yellowbrick.draw import bar_stack
  from yellowbrick.base import ModelVisualizer
  from yellowbrick.style.colors import resolve_colors
  from yellowbrick.utils import is_dataframe, is_classifier
  from yellowbrick.exceptions import YellowbrickTypeError, NotFitted
  from yellowbrick.exceptions import YellowbrickWarning, YellowbrickValueError
label_desc: Use image node_id 1 to create a new FeatureImportances object from inherited base classes: ModelVisualizer with example: obj = FeatureImportances(estimator, ax, labels, relative, absolute, xlabel, stack, colors, colormap, is_fitted, topn)