docstr: Fit the MCA for the dataframe X.
  
  The MCA is computed on the indicator matrix (i.e. `X.get_dummies()`). If some of the columns are already
  in indicator matrix format, you'll want to pass in `K` as the number of "real" variables that it represents.
  (That's used for correcting the inertia linked to each dimension.)
docstr_tok: ["Fit","the","MCA","for","the","dataframe","X",".","The","MCA","is","computed","on","the","indicator","matrix","(","i.e",".","`","X.get_dummies","(",")","`",")",".","If","some","of","the","columns","are","already","in","indicator","matrix","format",",","you","'ll","want","to","pass","in","`","K","`","as","the","number","of","``","real","''","variables","that","it","represents",".","(","That","'s","used","for","correcting","the","inertia","linked","to","each","dimension",".",")"]
code: def fit(self, X, y=None):
      """Fit the MCA for the dataframe X.
  
      The MCA is computed on the indicator matrix (i.e. `X.get_dummies()`). If some of the columns are already
      in indicator matrix format, you'll want to pass in `K` as the number of "real" variables that it represents.
      (That's used for correcting the inertia linked to each dimension.)
  
      """
  
      if self.check_input:
          sklearn.utils.check_array(X, dtype=[str, np.number])
  
      # K is the number of actual variables, to apply the Benzécri correction
      self.K_ = X.shape[1]
  
      # One-hot encode the data
      one_hot = self._prepare(X)
  
      # We need the number of columns to apply the Greenacre correction
      self.J_ = one_hot.shape[1]
  
      # Apply CA to the indicator matrix
      super().fit(one_hot)
  
      return self
  
file_path: prince/prince/mca.py
imports: from __future__ import annotations
  import numpy
  import pandas
  import sklearn.base
  import sklearn.utils
  from prince import utils
  from .None import ca
label_desc: Use image node_id 3 for calling the MCA obj's underlying member method code with example usage: obj.fit(X, y) and returns: self