class_docstr: Word correlation illustrates the extent to which words in a corpus appear in the
  same documents.
  
  WordCorrelationPlot visualizes the binary correlation between words across
  documents as a heatmap. The correlation is defined using the mean square
  contingency coefficient (phi-coefficient) between any two words m and n. The
  coefficient is a value between -1 and 1, inclusive. A value close to 1 or -1
  indicates strong positive or negative correlation between m and n, while a value
  close to 0 indicates little or no correlation. The constructor takes one required
  argument, which is the list of words or n-grams to be plotted.
  
  Parameters
  ----------
  words : list of str
      The list of words or n-grams to be plotted. The words must be present in the
      provided corpus on fit().
  
  ignore_case : bool, default: False
      If True, all words will be converted to lowercase before processing.
  
  ax : matplotlib Axes, default: None
      The axes to plot the figure on.
  
  cmap : str or cmap, default: "RdYlBu"
      Colormap to use for the heatmap.
  
  colorbar : bool, default: True
      If True, a colorbar will be added to the heatmap.
  
  fontsize : int, default: None
      Font size to use for the labels on the axes.
  
  kwargs : dict
      Pass any additional keyword arguments to the super class.
  
  Attributes
  ----------
  self.doc_term_matrix_ : array of shape (n_docs, n_features)
      The computed sparse document-term matrix containing binary values indicating if
      a word is present in a document.
  
  self.num_docs_ : int
      The number of observed documents in the corpus.
  
  self.vocab_ : dict
      A dictionary mapping words to their indices in the document-term matrix.
  
  self.num_features_ : int
      The number of features (word labels) in the resulting plot.
  
  self.correlation_matrix_ : ndarray of shape (n_features, n_features)
      The computed matrix containing the phi-coefficients between all features.
docstr: The fit method is the primary drawing input for the word correlation
  visualization.
  
  Parameters
  ----------
  X : list of str or generator
      Should be provided as a list of strings or a generator yielding strings
      that represent the documents in the corpus.
  
  y : None
      Labels are not used for the word correlation visualization.
  
  Returns
  -------
  self: instance
      Returns the instance of the transformer/visualizer.
  
  Attributes
  ----------
  self.doc_term_matrix_ : array of shape (n_docs, n_features)
      The computed sparse document-term matrix containing binary values
      indicating if a word is present in a document.
  
  self.num_docs_ : int
      The number of observed documents in the corpus.
  
  self.vocab_ : dict
      A dictionary mapping words to their indices in the document-term matrix.
  
  self.num_features_ : int
      The number of features (word labels) in the resulting plot.
  
  self.correlation_matrix_ : ndarray of shape (n_features, n_features)
      The computed matrix containing the phi-coefficients between all features.
docstr_tok: ["The","fit","method","is","the","primary","drawing","input","for","the","word","correlation","visualization",".","Parameters","--","--","--","--","--","X",":","list","of","str","or","generator","Should","be","provided","as","a","list","of","strings","or","a","generator","yielding","strings","that","represent","the","documents","in","the","corpus",".","y",":","None","Labels","are","not","used","for","the","word","correlation","visualization",".","Returns","--","--","--","-","self",":","instance","Returns","the","instance","of","the","transformer\/visualizer",".","Attributes","--","--","--","--","--","self.doc_term_matrix_",":","array","of","shape","(","n_docs",",","n_features",")","The","computed","sparse","document-term","matrix","containing","binary","values","indicating","if","a","word","is","present","in","a","document",".","self.num_docs_",":","int","The","number","of","observed","documents","in","the","corpus",".","self.vocab_",":","dict","A","dictionary","mapping","words","to","their","indices","in","the","document-term","matrix",".","self.num_features_",":","int","The","number","of","features","(","word","labels",")","in","the","resulting","plot",".","self.correlation_matrix_",":","ndarray","of","shape","(","n_features",",","n_features",")","The","computed","matrix","containing","the","phi-coefficients","between","all","features","."]
code: def fit(self, X, y=None):
      """
      The fit method is the primary drawing input for the word correlation
      visualization.
  
      Parameters
      ----------
      X : list of str or generator
          Should be provided as a list of strings or a generator yielding strings
          that represent the documents in the corpus.
  
      y : None
          Labels are not used for the word correlation visualization.
  
      Returns
      -------
      self: instance
          Returns the instance of the transformer/visualizer.
  
      Attributes
      ----------
      self.doc_term_matrix_ : array of shape (n_docs, n_features)
          The computed sparse document-term matrix containing binary values
          indicating if a word is present in a document.
  
      self.num_docs_ : int
          The number of observed documents in the corpus.
  
      self.vocab_ : dict
          A dictionary mapping words to their indices in the document-term matrix.
  
      self.num_features_ : int
          The number of features (word labels) in the resulting plot.
  
      self.correlation_matrix_ : ndarray of shape (n_features, n_features)
          The computed matrix containing the phi-coefficients between all features.
      """
  
      # Instantiate the CountVectorizer
      vecs = CountVectorizer(
          vocabulary=self.words,
          lowercase=self.ignore_case,
          ngram_range=self.ngram_range,
          binary=True,
      )
  
      # Get the binary document counts for the target words
      self.doc_term_matrix_ = vecs.fit_transform(X)
      self.num_docs_ = self.doc_term_matrix_.shape[0]
      self.vocab_ = vecs.vocabulary_
  
      # Verify that all target words exist in the corpus
      for word in self.words:
          if self.doc_term_matrix_.getcol(self.vocab_[word]).sum() == 0:
              raise YellowbrickValueError(
                  "Word '{}' does not exist in the corpus.".format(word)
              )
  
      # Compute the phi-coefficient for each pair of words
      self.num_features_ = len(self.words)
      self.correlation_matrix_ = np.zeros(
          (self.num_features_, self.num_features_)
      )
      for i, m in enumerate(self.words):
          for j, n in enumerate(self.words):
              self.correlation_matrix_[
                  i, j
              ] = self._compute_coefficient(m, n)
  
      self.draw(X)
      return self
  
file_path: yellowbrick/yellowbrick/text/correlation.py
imports: import numpy
  from sklearn.feature_extraction.text import CountVectorizer
  from yellowbrick.style import find_text_color
  from yellowbrick.text.base import TextVisualizer
  from yellowbrick.style.palettes import color_sequence
  from yellowbrick.exceptions import YellowbrickValueError
label_desc: Use image node_id 5 for calling the WordCorrelationPlot obj's underlying member method code with example usage: obj.fit(X, y) and returns: self