File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
mllib/src/main/scala/org/apache/spark/mllib/recommendation Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -438,15 +438,15 @@ class ALS private (
438438 }
439439
440440 // Solve the least-squares problem for each user and return the new feature vectors
441- userXtX.zip(userXy ).map { case (triangularXtX, rhs) =>
441+ Array .range( 0 , numUsers ).map { index =>
442442 // Compute the full XtX matrix from the lower-triangular part we got above
443- fillFullMatrix(triangularXtX , fullXtX)
443+ fillFullMatrix(userXtX(index) , fullXtX)
444444 // Add regularization
445445 (0 until rank).foreach(i => fullXtX.data(i* rank + i) += lambda)
446446 // Solve the resulting matrix, which is symmetric and positive-definite
447447 implicitPrefs match {
448- case false => Solve .solvePositive(fullXtX, rhs ).data
449- case true => Solve .solvePositive(fullXtX.addi(YtY .value.get), rhs ).data
448+ case false => Solve .solvePositive(fullXtX, userXy(index) ).data
449+ case true => Solve .solvePositive(fullXtX.addi(YtY .value.get), userXy(index) ).data
450450 }
451451 }
452452 }
You can’t perform that action at this time.
0 commit comments