code: def fit(self, X, y=None, **kwargs):
          
          X = pandas_to_numpy(X)
  
          random_state = check_random_state(self.random_state)
          self._enc_cluster_centroids, self._enc_map, self.labels_,\
              self.cost_, self.n_iter_ = k_modes(X,
                                                 self.n_clusters,
                                                 self.max_iter,
                                                 self.cat_dissim,
                                                 self.init,
                                                 self.n_init,
                                                 self.verbose,
                                                 random_state,
                                                 self.n_jobs)
          return self
docs: Compute k-modes clustering.
  
          Parameters
          ----------
          X : array-like, shape=[n_samples, n_features]