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: Predict labels of X
docstr_tok: ["Predict","labels","of","X"]
code: def predict(self, X=None, train_data=True, return_labels=False):
      """Predict labels of X"""
  
      fn = self.train_data_fn if train_data else self.test_data_fn
      pred_list = []
      if return_labels:
          labels_list = []
      for labels, text in data_loader(
          fn=fn, indices=X, batch_size=self.batch_size
      ):
          pred = [
              self.label2num[z[0]] for z in self.clf.predict(text)[0]
          ]
          pred_list.append(pred)
          if return_labels:
              labels_list.append(labels)
      pred = np.array([z for l in pred_list for z in l])
      if return_labels:
          gold_labels = [
              self.label2num[z] for l in labels_list for z in l
          ]
          return (pred, np.array(gold_labels))
      else:
          return pred
  
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 7 for calling the FastTextClassifier obj's underlying member method code with example usage: obj.predict(X, train_data, return_labels) and returns: pred,  np, pred