class_docstr: Instantiate a fastText classifier that is compatible with :py:class:`CleanLearning <cleanlab.classification.CleanLearning>`.
  
  Parameters
  ----------
  train_data_fn: str
      File name of the training data in the format compatible with fastText.
  
  test_data_fn: str, optional
      File name of the test data in the format compatible with fastText.
class_docstr_tok: ["Instantiate","a","fastText","classifier","that","is","compatible","with",":","py",":","class",":","`","CleanLearning","<","cleanlab.classification.CleanLearning",">","`",".","Parameters","--","--","--","--","--","train_data_fn",":","str","File","name","of","the","training","data","in","the","format","compatible","with","fastText",".","test_data_fn",":","str",",","optional","File","name","of","the","test","data","in","the","format","compatible","with","fastText","."]
code: def __init__(
      self,
      train_data_fn,
      test_data_fn=None,
      labels=None,
      tmp_dir="",
      label=LABEL,
      del_intermediate_data=True,
      kwargs_train_supervised={},
      p_at_k=1,
      batch_size=1000,
  ):
      self.train_data_fn = train_data_fn
      self.test_data_fn = test_data_fn
      self.tmp_dir = tmp_dir
      self.label = label
      self.del_intermediate_data = del_intermediate_data
      self.kwargs_train_supervised = kwargs_train_supervised
      self.p_at_k = p_at_k
      self.batch_size = batch_size
      self.clf = None
      self.labels = labels
  
      if labels is None:
          # Find all class labels across the train and test set (if provided)
          unique_labels = set([])
          for labels, _ in data_loader(
              fn=train_data_fn, batch_size=batch_size
          ):
              unique_labels = unique_labels.union(set(labels))
          if test_data_fn is not None:
              for labels, _ in data_loader(
                  fn=test_data_fn, batch_size=batch_size
              ):
                  unique_labels = unique_labels.union(set(labels))
      else:
          # Prepend labels with self.label token (e.g. '__label__').
          unique_labels = [label + str(l) for l in labels]
      # Create maps: label strings <-> integers when label strings are used
      unique_labels = sorted(list(unique_labels))
      self.label2num = dict(
          zip(unique_labels, range(len(unique_labels)))
      )
      self.num2label = dict((y, x) for x, y in self.label2num.items())
  
file_path: cleanlab/cleanlab/models/fasttext.py
imports: import time
  import os
  import copy
  import numpy
  from sklearn.base import BaseEstimator
  from fasttext import train_supervised, load_model
label_desc: Use image node_id 1 to create a new FastTextClassifier object from inherited base classes: BaseEstimator with example: obj = FastTextClassifier(train_data_fn, test_data_fn, labels, tmp_dir, label, del_intermediate_data, kwargs_train_supervised, p_at_k, batch_size)