class_docstr: A wrapper class to apply sklearn clustering models on DocumentEmbeddings.
class_docstr_tok: ["A","wrapper","class","to","apply","sklearn","clustering","models","on","DocumentEmbeddings","."]
docstr: Trains the model.
  
  Args:
      corpus: the flair corpus this wrapper will use for fitting the model.
      **kwargs: parameters propagated to the models `.fit()` method.
docstr_tok: ["Trains","the","model",".","Args",":","corpus",":","the","flair","corpus","this","wrapper","will","use","for","fitting","the","model",".","*","*","kwargs",":","parameters","propagated","to","the","models","`",".fit","(",")","`","method","."]
code: def fit(self, corpus: Corpus, **kwargs):
      """Trains the model.
  
      Args:
          corpus: the flair corpus this wrapper will use for fitting the model.
          **kwargs: parameters propagated to the models `.fit()` method.
      """
      X = self._convert_dataset(corpus)
  
      log.info(
          "Start clustering "
          + str(self.model)
          + " with "
          + str(len(X))
          + " Datapoints."
      )
      self.model.fit(X, **kwargs)
      log.info("Finished clustering.")
  
imports: import logging
  import pickle
  from collections import OrderedDict
  from pathlib import Path
  from typing import Optional, Union
  import joblib
  from sklearn.base import BaseEstimator, ClusterMixin
  from sklearn.metrics import normalized_mutual_info_score
  from tqdm import tqdm
  from flair.data import Corpus, _iter_dataset
  from flair.datasets import DataLoader
  from flair.embeddings import DocumentEmbeddings
label_desc: Use image node_id 2 for calling the ClusteringModel obj's underlying member method code with example usage: obj.fit(corpus) without return types