class_docstr: Base classes for ML1M and ML10M.
class_docstr_tok: ["Base","classes","for","ML1M","and","ML10M","."]
docstr: Return the rating data (from ``ratings.dat``).
  
  >>> ml = ML10M()
  >>> ml.ratings
             user  item  rating  timestamp
  0             1   122     5.0  838985046
  1             1   185     5.0  838983525
  2             1   231     5.0  838983392
  3             1   292     5.0  838983421
  4             1   316     5.0  838983392
  ...
  [10000054 rows x 4 columns]
docstr_tok: ["Return","the","rating","data","(","from","``","ratings.dat","``",")",".",">",">",">","ml","=","ML10M","(",")",">",">",">","ml.ratings","user","item","rating","timestamp","0","1","122","5.0","838985046","1","1","185","5.0","838983525","2","1","231","5.0","838983392","3","1","292","5.0","838983421","4","1","316","5.0","838983392","...","[","10000054","rows","x","4","columns","]"]
code: def ratings(self):
      """
      Return the rating data (from ``ratings.dat``).
  
      >>> ml = ML10M()
      >>> ml.ratings
                 user  item  rating  timestamp
      0             1   122     5.0  838985046
      1             1   185     5.0  838983525
      2             1   231     5.0  838983392
      3             1   292     5.0  838983421
      4             1   316     5.0  838983392
      ...
      [10000054 rows x 4 columns]
      """
      fn = self.path / "ratings.dat"
      ratings = pd.read_csv(
          fn,
          sep=":",
          header=None,
          names=[
              "user",
              "_ui",
              "item",
              "_ir",
              "rating",
              "_rt",
              "timestamp",
          ],
          usecols=[0, 2, 4, 6],
          dtype={
              "user": np.int32,
              "item": np.int32,
              "rating": np.float32,
              "timestamp": np.int32,
          },
      )
      _log.debug("loaded %s", fn)
      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 MLM obj's underlying member method code with example usage: obj.ratings() and returns: ratings