Ah, that's a good point Matei. I think this would work fine in Java too. In
Java I mostly see a mixture of "setXYZ" or just "xyz" with a final
"build()" at the end. I guess it's not such a big deal in the end, it just
may look a bit Java-ish to Scala developers.


On Fri, Jul 5, 2013 at 3:08 PM, Matei Zaharia <notifications@github.com>wrote:

> In mllib/src/main/scala/spark/ml/recommendation/ALS.scala:
>
> > + * information about the ratings matrix to determine the "out-links" of each user (which blocks of
> > + * products it will contribute to) and "in-link" information for each product (which of the feature
> > + * vectors it receives from each user block it will depend on). This allows us to send only an
> > + * array of feature vectors between each user block and product block, and have the product block
> > + * find the users' ratings and update the products based on these messages.
> > + */
> > +class ALS private (var numBlocks: Int, var rank: Int, var iterations: Int, var lambda: Double)
> > +  extends Serializable
> > +{
> > +  def this() = this(-1, 10, 10, 0.01)
> > +
> > +  /**
> > +   * Set the number of blocks to parallelize the computation into; pass -1 for an auto-configured
> > +   * number of blocks. Default: -1.
> > +   */
> > +  def setBlocks(numBlocks: Int): ALS = {
>
> Ryan, this is probably not super clear from the commit but the purpose of
> the builder API is to be available from Java. Do people commonly use withthere too?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mesos/spark/pull/678/files#r5050776>
> .
>