class_docstr: Rank2D performs pairwise comparisons of each feature in the data set with
  a specific metric or algorithm (e.g. Pearson correlation) then returns
  them ranked as a lower left triangle diagram.
  
  Parameters
  ----------
  
  algorithm : str, default: 'pearson'
      The ranking algorithm to use, one of: 'pearson', 'covariance', 'spearman',
      or 'kendalltau'.
  
  features : list
      A list of feature names to use.
      If a DataFrame is passed features is None, feature
      names are selected as the columns of the DataFrame.
  
  colormap : string or cmap, default: 'RdBu_r'
      optional string or matplotlib cmap to colorize lines
      Use either color to colorize the lines on a per class basis or colormap to
      color them on a continuous scale.
  
  figsize : tuple, optional
          (width, height) for specifying the size of the plot
  
  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).
  
  Attributes
  ----------
  ranks_ : ndarray
      An array of rank scores with shape (n,n), where n is the
      number of features.
  
  Examples
  ----------
  .. plot:: ../examples/feature_ranking_2D.py
  
  Notes
  -----
  .. versionadded:: 0.8.4
class_docstr_tok: ["Rank2D","performs","pairwise","comparisons","of","each","feature","in","the","data","set","with","a","specific","metric","or","algorithm","(","e.g",".","Pearson","correlation",")","then","returns","them","ranked","as","a","lower","left","triangle","diagram",".","Parameters","--","--","--","--","--","algorithm",":","str",",","default",":","'pearson'","The","ranking","algorithm","to","use",",","one","of",":","'pearson","'",",","'covariance","'",",","'spearman","'",",","or","'kendalltau","'",".","features",":","list","A","list","of","feature","names","to","use",".","If","a","DataFrame","is","passed","features","is","None",",","feature","names","are","selected","as","the","columns","of","the","DataFrame",".","colormap",":","string","or","cmap",",","default",":","'RdBu_r'","optional","string","or","matplotlib","cmap","to","colorize","lines","Use","either","color","to","colorize","the","lines","on","a","per","class","basis","or","colormap","to","color","them","on","a","continuous","scale",".","figsize",":","tuple",",","optional","(","width",",","height",")","for","specifying","the","size","of","the","plot","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",")",".","Attributes","--","--","--","--","--","ranks_",":","ndarray","An","array","of","rank","scores","with","shape","(","n",",","n",")",",","where","n","is","the","number","of","features",".","Examples","--","--","--","--","--","..","plot",":",":","..","\/examples\/feature_ranking_2D.py","Notes","--","--","-","..","versionadded",":",":","0.8.4"]
docstr: Draws the heatmap of the ranking matrix of variables.
docstr_tok: ["Draws","the","heatmap","of","the","ranking","matrix","of","variables","."]
code: def _draw(self):
      """
      Draws the heatmap of the ranking matrix of variables.
      """
  
      title = "{} Ranking of {} Features".format(
          self.algorithm.title(), len(self.features_)
      )
      self.ax.set_title(title)
  
      # Set the axes aspect to be equal
      self.ax.set_aspect("equal")
  
      # Generate a mask for the upper triangle
      mask = np.zeros_like(self.ranks_, dtype=bool)
      mask[np.triu_indices_from(mask)] = True
  
      # Draw the heatmap
      data = np.ma.masked_where(mask, self.ranks_)
      mesh = self.ax.pcolormesh(
          data, cmap=self.colormap, vmin=-1, vmax=1
      )
  
      # Set the Axis limits
      self.ax.set(xlim=(0, data.shape[1]), ylim=(0, data.shape[0]))
  
      # Add the colorbar
      cb = self.ax.figure.colorbar(
          mesh, None, self.ax, fraction=0.046, pad=0.04
      )
      cb.outline.set_linewidth(0)
  
      # Reverse the rows to get the lower left triangle
      self.ax.invert_yaxis()
  
      # Add ticks and tick labels
      self.ax.set_xticks(np.arange(len(self.ranks_)) + 0.5)
      self.ax.set_yticks(np.arange(len(self.ranks_)) + 0.5)
      self.ax.set_xticklabels(self.features_, rotation=90)
      self.ax.set_yticklabels(self.features_)
  
imports: import numpy
  import pandas
  from scipy.stats import shapiro
  from scipy.stats import spearmanr
  from scipy.stats import kendalltau
  from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
  from ploomber_core.exceptions import modify_exceptions
  import matplotlib.pyplot
label_desc: Use image node_id 3 for calling the Rank2D obj's underlying member method code with example usage: obj._draw() without return types