class_docstr: Test data conversion to libsvm and libffm inside LRModel, FMModel and FFMModel
docstr: Test if the conversion between libsvm and numpy array is correct
docstr_tok: ["Test","if","the","conversion","between","libsvm","and","numpy","array","is","correct"]
code: def test_convert_numpy_to_libsvm(self):
      """
      Test if the conversion between libsvm and numpy array is correct
      """
  
      file = tempfile.NamedTemporaryFile(delete=False)
  
      # write to temporary files
      write_data_to_xlearn_format(self.X, self.y, file.name)
  
      # load data back and compare if they are the same as original data
      X_true, y_true = load_svmlight_file(file.name)
      file.close()
      if os.path.exists(file.name):
          os.remove(file.name)
  
      assert np.all(np.isclose(self.X, X_true.todense()))
      assert np.all(self.y.ravel() == y_true.ravel())
  
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 3 for calling the TestDataConversion obj's underlying member method code with example usage: obj.test_convert_numpy_to_libsvm() without return types