Skip to content

Commit 3d5d8a6

Browse files
committed
Add more clarifying explanation about OutBlocks
1 parent 983f9eb commit 3d5d8a6

File tree

1 file changed

+9
-1
lines changed
  • mllib/src/main/scala/org/apache/spark/ml/recommendation

1 file changed

+9
-1
lines changed

mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,15 @@ object ALS extends DefaultParamsReadable[ALS] with Logging {
965965
* )
966966
* }}}
967967
*
968-
* The data structure encodes the following information:
968+
* Each value in this map-like sequence is of type `Array[Array[Int]]`. The values in the
969+
* inner array are the ranks of the sorted user IDs in that partition; so in the example above,
970+
* `Array(0, 1)` in partition 0 refers to user IDs 0 and 6, since when all unique user IDs in
971+
* partition 0 are sorted, 0 is the first ID and 6 is the second. The position of each inner
972+
* array in its enclosing outer array denotes the partition number to which item IDs map; in the
973+
* example, the first `Array(0, 1)` is in position 0 of its outer array, denoting item IDs that
974+
* map to partition 0.
975+
*
976+
* In summary, the data structure encodes the following information:
969977
*
970978
* * There are ratings with user IDs 0 and 6 (encoded in `Array(0, 1)`, where 0 and 1 are the
971979
* indices of the user IDs 0 and 6 on partition 0) whose item IDs map to partitions 0 and 1

0 commit comments

Comments
 (0)