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","."]
docstr: Returns filename of the masked fasttext data file.
  Items are written in the order they are in the file,
  regardless if indices are provided.
docstr_tok: ["Returns","filename","of","the","masked","fasttext","data","file",".","Items","are","written","in","the","order","they","are","in","the","file",",","regardless","if","indices","are","provided","."]
code: def _create_train_data(self, data_indices):
      """Returns filename of the masked fasttext data file.
      Items are written in the order they are in the file,
      regardless if indices are provided."""
  
      # If X indexes all training data, no need to rewrite the file.
      if data_indices is None:
          self.masked_data_was_created = False
          return self.train_data_fn
      # Mask training data by data_indices
      else:
          len_label = len(LABEL)
          data_indices = sorted(data_indices, reverse=True)
          masked_fn = "fastTextClf_" + str(int(time.time())) + ".txt"
          open(masked_fn, "w").close()
          # Read in training data one line at a time
          with open(self.train_data_fn, "r") as rf:
              idx = 0
              data_idx = data_indices.pop()
              for line in rf:
                  # Mask by data_indices
                  if idx == data_idx:
                      with open(masked_fn, "a") as wf:
                          wf.write(
                              line.strip().replace("\n", NEWLINE) + "\n"
                          )
                      if line[:len_label] == LABEL:
                          if len(data_indices):
                              data_idx = data_indices.pop()
                          else:
                              break
                  # Increment data index if starts with __label__
                  # This enables support for text data containing '\n'.
                  if line[:len_label] == LABEL:
                      idx += 1
          self.masked_data_was_created = True
  
      return masked_fn
  
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 2 for calling the FastTextClassifier obj's underlying member method code with example usage: obj._create_train_data(data_indices) and returns: masked_fn, self