class_docstr: Base class that holds necessary (minimal) information needed
docstr: Generate train, test split. The split is performed on the row
  entities. So, this essentially becomes a cold start row entity test.
  
  Args:
      data (csr_matrix): The entire target matrix.
      test_ratio (float): Ratio of test split.
docstr_tok: ["Generate","train",",","test","split",".","The","split","is","performed","on","the","row","entities",".","So",",","this","essentially","becomes","a","cold","start","row","entity","test",".","Args",":","data","(","csr_matrix",")",":","The","entire","target","matrix",".","test_ratio","(","float",")",":","Ratio","of","test","split","."]
code: def generate_train_test_data(self, data, test_ratio=0.3):
      """Generate train, test split. The split is performed on the row
      entities. So, this essentially becomes a cold start row entity test.
  
      Args:
          data (csr_matrix): The entire target matrix.
          test_ratio (float): Ratio of test split.
  
      """
      self.training_data = DataPtr(data, self.entities)
      self.test_data = DataPtr(data, self.entities)
  
      (
          self.training_data.data_indices,
          self.test_data.data_indices,
      ) = train_test_split(
          np.array(range(0, data.shape[0])),
          test_size=test_ratio,
          shuffle=True,
          random_state=0,
      )
      self.training_data.entity_indices[
          0
      ] = self.training_data.data_indices
      self.test_data.entity_indices[0] = self.test_data.data_indices
  
imports: import logging
  import pandas
  import numpy
  from scipy.sparse import coo_matrix, isspmatrix_csr
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import normalize
  from recommenders.utils.python_utils import binarize
  from .geoimc_utils import length_normalize, reduce_dims
label_desc: Use image node_id 3 for calling the Dataset obj's underlying member method code with example usage: obj.generate_train_test_data(data, test_ratio) without return types