class_docstr: Test data conversion to libsvm and libffm inside LRModel, FMModel and FFMModel
docstr: An internal function for reading libffm back to numpy array.
docstr_tok: ["An","internal","function","for","reading","libffm","back","to","numpy","array","."]
code: def _read_libffm_file(self, filename):
      """
      An internal function for reading libffm back to numpy array.
      """
  
      X_true = np.zeros((self.num_rows, self.num_features))
      y_true = np.zeros((self.num_rows, 1))
      field_true = np.zeros((self.num_features, 1))
      with open(filename, "r") as f:
          i = 0
          for line in f:
              tmp_row = line.replace("\n", "").split(" ")
  
              # extract label
              y_true[i] = int(tmp_row[0])
  
              # extract data and fields
              for k in range(1, len(tmp_row)):
                  if len(tmp_row[k]) > 0:
                      tmp_str = tmp_row[k].split(":")
                      j = int(tmp_str[1])
                      field_true[j] = int(tmp_str[0])
                      tmp_data = float(tmp_str[2])
                      X_true[i, j] = tmp_data
              i = i + 1
  
      return X_true, y_true, field_true
  
file_path: xlearn/python-package/test/test_data_conversion.py
imports: import unittest
  import tempfile
  import os
  import numpy
  from xlearn import write_data_to_xlearn_format
  from scipy.sparse import csr_matrix
  from sklearn.datasets import load_svmlight_file
label_desc: Use image node_id 2 for calling the TestDataConversion obj's underlying member method code with example usage: obj._read_libffm_file(filename) and returns: X_true,  y_true,  field_true