Are you referring to fitting the intercept term? You can use lr.setFitIntercept (though it is true by default):
scala> lr.explainParam(lr.fitIntercept) res27: String = fitIntercept: whether to fit an intercept term (default: true) On Mon, 11 Apr 2016 at 21:59 Daniel Siegmann <daniel.siegm...@teamaol.com> wrote: > I'm trying to understand how I can add a bias when training in Spark. I > have only a vague familiarity with this subject, so I hope this question > will be clear enough. > > Using liblinear a bias can be set - if it's >= 0, there will be an > additional weight appended in the model, and predicting with that model > will automatically append a feature for the bias. > > Is there anything similar in Spark, such as for logistic regression? The > closest thing I can find is MLUtils.appendBias, but this seems to require > manual work on both the training and scoring side. I was hoping for > something that would just be part of the model. > > > ~Daniel Siegmann >