code: def feature_correlation(
      X,
      y,
      ax=None,
      method="pearson",
      labels=None,
      sort=False,
      feature_index=None,
      feature_names=None,
      color=None,
      show=True,
      **kwargs,
  ):
      """
      Displays the correlation between features and dependent variables.
  
      This visualizer can be used side-by-side with
      yellowbrick.features.JointPlotVisualizer that plots a feature
      against the target and shows the distribution of each via a
      histogram on each axis.
  
      Parameters
      ----------
      X : ndarray or DataFrame of shape n x m
          A matrix of n instances with m features
  
      y : ndarray or Series of length n
          An array or series of target or class values
  
      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).
  
      method : str, default: 'pearson'
          The method to calculate correlation between features and target.
          Options include:
  
              - 'pearson', which uses ``scipy.stats.pearsonr``
              - 'mutual_info-regression', which uses ``mutual_info-regression``
                from ``sklearn.feature_selection``
              - 'mutual_info-classification', which uses ``mutual_info_classif``
                from ``sklearn.feature_selection``
  
      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.
  
      sort : boolean, default: False
          If false, the features are are not sorted in the plot; otherwise
          features are sorted in ascending order of correlation.
  
      feature_index : list,
          A list of feature index to include in the plot.
  
      feature_names : list of feature names
          A list of feature names to include in the plot.
          Must have labels or the fitted data is a DataFrame with column names.
          If feature_index is provided, feature_names will be ignored.
  
      color: string
          Specify color for barchart
  
      show: bool, default: True
          If True, calls ``show()``, which in turn calls ``plt.show()`` however you cannot
          call ``plt.savefig`` from this signature, nor ``clear_figure``. If False, simply
          calls ``finalize()``
  
      kwargs : dict
          Keyword arguments that are passed to the base class and may influence
          the visualization as defined in other Visualizers.
  
      Returns
      -------
      visualizer : FeatureCorrelation
          Returns the fitted visualizer.
      """
  
      # Instantiate the visualizer
      visualizer = FeatureCorrelation(
          ax=ax,
          method=method,
          labels=labels,
          sort=sort,
          color=color,
          feature_index=feature_index,
          feature_names=feature_names,
          **kwargs,
      )
  
      # Fit and transform the visualizer (calls draw)
      visualizer.fit(X, y, **kwargs)
      if show:
          visualizer.show()
      else:
          visualizer.finalize()
  
      # Return the visualizer
      return visualizer
  
file_path: yellowbrick/yellowbrick/target/feature_correlation.py
imports: import numpy
  from yellowbrick.utils import is_dataframe
  from yellowbrick.target.base import TargetVisualizer
  from yellowbrick.exceptions import YellowbrickValueError, YellowbrickWarning
  from sklearn.feature_selection import mutual_info_classif
  from sklearn.feature_selection import mutual_info_regression
  from scipy.stats import pearsonr
label_desc: Use image node_id 1 for calling a global function with example usage: feature_correlation(X, y, ax, method, labels, sort, feature_index, feature_names, color, show) and returns: visualizer