You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by dl...@apache.org on 2014/08/20 22:57:21 UTC
svn commit: r1619229 -
/mahout/site/mahout_cms/trunk/content/users/sparkbindings/play-with-shell.mdtext
Author: dlyubimov
Date: Wed Aug 20 20:57:21 2014
New Revision: 1619229
URL: http://svn.apache.org/r1619229
Log:
CMS commit to mahout by dlyubimov
Modified:
mahout/site/mahout_cms/trunk/content/users/sparkbindings/play-with-shell.mdtext
Modified: mahout/site/mahout_cms/trunk/content/users/sparkbindings/play-with-shell.mdtext
URL: http://svn.apache.org/viewvc/mahout/site/mahout_cms/trunk/content/users/sparkbindings/play-with-shell.mdtext?rev=1619229&r1=1619228&r2=1619229&view=diff
==============================================================================
--- mahout/site/mahout_cms/trunk/content/users/sparkbindings/play-with-shell.mdtext (original)
+++ mahout/site/mahout_cms/trunk/content/users/sparkbindings/play-with-shell.mdtext Wed Aug 20 20:57:21 2014
@@ -137,16 +137,15 @@ We hope that we could show that Mahout's
We put all the commands for ordinary least squares into a function ```ols```.
<div class="codehilite"><pre>
-def ols(drmX: DrmLike[Int], y: Vector) = {
+def ols(drmX: DrmLike[Int], y: Vector) =
+ solve(drmX.t %*% drmX, drmX.t %*% y)(::,0)
- val XtX = (drmX.t %*% drmX).collect
- val Xty = (drmX.t %*% y).collect(::, 0)
-
- solve(XtX, Xty)
-}
</pre></div>
-And we define a function ```goodnessOfFit``` that tells how well a model fits the target variable:
+Note that DSL declares implicit `collect` if coersion rules require an in-core argument. Hence, we can simply
+skip explicit `collect`s.
+
+Next, we define a function ```goodnessOfFit``` that tells how well a model fits the target variable:
<div class="codehilite"><pre>
def goodnessOfFit(drmX: DrmLike[Int], beta: Vector, y: Vector) = {