Rating

class pyspark.mllib.recommendation.Rating[source]

Represents a (user, product, rating) tuple.

>>> r = Rating(1, 2, 5.0)
>>> (r.user, r.product, r.rating)
(1, 2, 5.0)
>>> (r[0], r[1], r[2])
(1, 2, 5.0)

New in version 1.2.0.

Methods

Attributes

Methods Documentation

count(value) → integer – return number of occurrences of value
index(value[, start[, stop]]) → integer – return first index of value.

Raises ValueError if the value is not present.

Attributes Documentation

product

Alias for field number 1

rating

Alias for field number 2

user

Alias for field number 0