code: def draw(self, **kwargs):
          
          # Quick validation
          for param in ('feature_importances_', 'features_'):
              if not hasattr(self, param):
                  raise NotFitted("missing required param '{}'".format(param))
  
          # Find the positions for each bar
          pos = np.arange(self.features_.shape[0]) + 0.5
  
          # Plot the bar chart
          if self.stack:
              colors = color_palette(kwargs.pop('colors', None),
                                     len(self.classes_))
              zeros = np.zeros(self.feature_importances_.shape[1])
              left_arr = np.zeros((self.feature_importances_.shape[1], 2))
  
              for idx in range(len(self.feature_importances_)):
                  left = [
                      left_arr[j, int(self.feature_importances_[idx][j] > 0)]
                      for j in range(len(self.feature_importances_[idx]))
                  ]
  
                  self.ax.barh(pos, self.feature_importances_[idx], left=left,
                               color=colors[idx], label=self.classes_[idx])
  
                  left_arr[:, 0] += np.minimum(self.feature_importances_[idx],
                                               zeros)
                  left_arr[:, 1] += np.maximum(self.feature_importances_[idx],
                                               zeros)
          else:
              self.ax.barh(pos, self.feature_importances_, align='center')
  
          # Set the labels for the bars
          self.ax.set_yticks(pos)
          self.ax.set_yticklabels(self.features_)
  
          return self.ax
docs: Draws the feature importances as a bar chart; called from fit.