class_docstr: Base visualizer for Rank1D and Rank2D
  Parameters
  ----------
  algorithm : string
      The ranking algorithm to use; options and defaults vary by subclass
  
  features : list
      A list of feature names to use.
      If a DataFrame is passed as input and features is None, feature
      names are selected as the columns of the DataFrame.
  
  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 n-dimensional, symmetric array of rank scores, where n is the
      number of features. E.g. for 1D ranking, it is (n,), for a
      2D ranking it is (n,n) and so forth.
  
  Notes
  -----
  .. versionadded:: 0.8.4
class_docstr_tok: ["Base","visualizer","for","Rank1D","and","Rank2D","Parameters","--","--","--","--","--","algorithm",":","string","The","ranking","algorithm","to","use",";","options","and","defaults","vary","by","subclass","features",":","list","A","list","of","feature","names","to","use",".","If","a","DataFrame","is","passed","as","input","and","features","is","None",",","feature","names","are","selected","as","the","columns","of","the","DataFrame",".","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","n-dimensional",",","symmetric","array","of","rank","scores",",","where","n","is","the","number","of","features",".","E.g",".","for","1D","ranking",",","it","is","(","n",",",")",",","for","a","2D","ranking","it","is","(","n",",","n",")","and","so","forth",".","Notes","--","--","-","..","versionadded",":",":","0.8.4"]
code: def _derive_features_from_ranks(self, ranks):
      if self.features is None:
          self.features_ = np.arange(0, len(ranks))
      else:
          if len(self.features) != len(ranks):
              raise ValueError(
                  (
                      "number of supplied feature names does not match the number "
                      "of ranks provided."
                  )
              )
          self.features_ = np.array(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 4 for calling the RankD obj's underlying member method code with example usage: obj._derive_features_from_ranks(ranks) without return types