class_docstr: Code for reading current MovieLens data sets, including ML-20M, ML-Latest, and
  ML-Latest-Small.
  
  Parameters:
      path(str or pathlib.Path): Path to the directory containing the data set.
class_docstr_tok: ["Code","for","reading","current","MovieLens","data","sets",",","including","ML-20M",",","ML-Latest",",","and","ML-Latest-Small",".","Parameters",":","path","(","str","or","pathlib.Path",")",":","Path","to","the","directory","containing","the","data","set","."]
docstr: The rating table.
  
  >>> mlsmall = MovieLens('data/ml-latest-small')
  >>> mlsmall.ratings
          user  item  rating   timestamp
  0          1    31     2.5  1260759144
  1          1  1029     3.0  1260759179
  2          1  1061     3.0  1260759182
  3          1  1129     2.0  1260759185
  4          1  1172     4.0  1260759205
  ...
  [100004 rows x 4 columns]
docstr_tok: ["The","rating","table",".",">",">",">","mlsmall","=","MovieLens","(","'data\/ml-latest-small","'",")",">",">",">","mlsmall.ratings","user","item","rating","timestamp","0","1","31","2.5","1260759144","1","1","1029","3.0","1260759179","2","1","1061","3.0","1260759182","3","1","1129","2.0","1260759185","4","1","1172","4.0","1260759205","...","[","100004","rows","x","4","columns","]"]
code: def ratings(self):
      """
      The rating table.
  
      >>> mlsmall = MovieLens('data/ml-latest-small')
      >>> mlsmall.ratings
              user  item  rating   timestamp
      0          1    31     2.5  1260759144
      1          1  1029     3.0  1260759179
      2          1  1061     3.0  1260759182
      3          1  1129     2.0  1260759185
      4          1  1172     4.0  1260759205
      ...
      [100004 rows x 4 columns]
      """
  
      fn = self.path / "ratings.csv"
      ratings = pd.read_csv(
          fn,
          dtype={
              "movieId": np.int32,
              "userId": np.int32,
              "rating": np.float64,
              "timestamp": np.int32,
          },
      )
      ratings.rename(
          columns={"userId": "user", "movieId": "item"}, inplace=True
      )
      _log.debug(
          "loaded %s, takes %d bytes", fn, ratings.memory_usage().sum()
      )
      return ratings
  
imports: import os.path
  from pathlib import Path
  import logging
  import pandas
  import numpy
  from lenskit.util import cached
label_desc: Use image node_id 2 for calling the MovieLens obj's underlying member method code with example usage: obj.ratings() and returns: ratings