Rating

class pyspark.mllib.recommendation.Rating[source]

Represents a (user, product, rating) tuple.

New in version 1.2.0.

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=0, stop=sys.maxsize, /)

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