Rating

class pyspark.mllib.recommendation.Rating

Represents a (user, product, rating) tuple.

Examples

>>> 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)

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

product

Alias for field number 1

rating

Alias for field number 2

user

Alias for field number 0

Methods Documentation

count(value, /)

Return number of occurrences of value.

index(value, start, stop, /)

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