class_docstr: Graph modality
  
  Parameters
  ----------
  data: List[str], required
      A list encoding an adjacency matrix, of a user or an item graph, in the sparse triplet format,         e.g., data=[('user1', 'user4', 1.0)].
class_docstr_tok: ["Graph","modality","Parameters","--","--","--","--","--","data",":","List","[","str","]",",","required","A","list","encoding","an","adjacency","matrix",",","of","a","user","or","an","item","graph",",","in","the","sparse","triplet","format",",","e.g.",",","data=","[","(","'user1","'",",","'user4","'",",","1.0",")","]","."]
docstr: Return the adjacency matrix in scipy csr sparse format
          
docstr_tok: ["Return","the","adjacency","matrix","in","scipy","csr","sparse","format"]
code: def matrix(self):
      """Return the adjacency matrix in scipy csr sparse format"""
      if self.__matrix is None:
          assert self.__matrix_size is not None
          self.__matrix = sp.csr_matrix(
              (self.val, (self.map_rid, self.map_cid)),
              shape=(self.__matrix_size, self.__matrix_size),
          )
      return self.__matrix
  
file_path: cornac/cornac/data/graph.py
imports: import scipy.sparse
  import numpy
  from tqdm.auto import trange
  from .None import FeatureModality
label_desc: Use image node_id 2 for calling the GraphModality obj's underlying member method code with example usage: obj.matrix() and returns: self