From adc700582b52c730a4dbf2a45d4cc794be43cfe5 Mon Sep 17 00:00:00 2001
From: Shivaram Venkataraman <shivaram@eecs.berkeley.edu>
Date: Fri, 30 Aug 2013 00:16:32 -0700
Subject: [PATCH] Fix broken build by removing addIntercept

---
 .../spark/mllib/regression/LinearRegression.scala      |  9 ++++-----
 .../scala/spark/mllib/regression/RidgeRegression.scala | 10 ++++------
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/mllib/src/main/scala/spark/mllib/regression/LinearRegression.scala b/mllib/src/main/scala/spark/mllib/regression/LinearRegression.scala
index 5b3743f2fa..885ff5a30d 100644
--- a/mllib/src/main/scala/spark/mllib/regression/LinearRegression.scala
+++ b/mllib/src/main/scala/spark/mllib/regression/LinearRegression.scala
@@ -47,8 +47,7 @@ class LinearRegressionModel(
 class LinearRegressionWithSGD private (
     var stepSize: Double,
     var numIterations: Int,
-    var miniBatchFraction: Double,
-    var addIntercept: Boolean)
+    var miniBatchFraction: Double)
   extends GeneralizedLinearAlgorithm[LinearRegressionModel]
   with Serializable {
 
@@ -61,7 +60,7 @@ class LinearRegressionWithSGD private (
   /**
    * Construct a LinearRegression object with default parameters
    */
-  def this() = this(1.0, 100, 1.0, true)
+  def this() = this(1.0, 100, 1.0)
 
   def createModel(weights: Array[Double], intercept: Double) = {
     new LinearRegressionModel(weights, intercept)
@@ -94,7 +93,7 @@ object LinearRegressionWithSGD {
       initialWeights: Array[Double])
     : LinearRegressionModel =
   {
-    new LinearRegressionWithSGD(stepSize, numIterations, miniBatchFraction, true).run(input,
+    new LinearRegressionWithSGD(stepSize, numIterations, miniBatchFraction).run(input,
       initialWeights)
   }
 
@@ -115,7 +114,7 @@ object LinearRegressionWithSGD {
       miniBatchFraction: Double)
     : LinearRegressionModel =
   {
-    new LinearRegressionWithSGD(stepSize, numIterations, miniBatchFraction, true).run(input)
+    new LinearRegressionWithSGD(stepSize, numIterations, miniBatchFraction).run(input)
   }
 
   /**
diff --git a/mllib/src/main/scala/spark/mllib/regression/RidgeRegression.scala b/mllib/src/main/scala/spark/mllib/regression/RidgeRegression.scala
index ccf7364806..cb1303dd99 100644
--- a/mllib/src/main/scala/spark/mllib/regression/RidgeRegression.scala
+++ b/mllib/src/main/scala/spark/mllib/regression/RidgeRegression.scala
@@ -48,8 +48,7 @@ class RidgeRegressionWithSGD private (
     var stepSize: Double,
     var numIterations: Int,
     var regParam: Double,
-    var miniBatchFraction: Double,
-    var addIntercept: Boolean)
+    var miniBatchFraction: Double)
     extends GeneralizedLinearAlgorithm[RidgeRegressionModel]
   with Serializable {
 
@@ -71,7 +70,7 @@ class RidgeRegressionWithSGD private (
   /**
    * Construct a RidgeRegression object with default parameters
    */
-  def this() = this(1.0, 100, 1.0, 1.0, true)
+  def this() = this(1.0, 100, 1.0, 1.0)
 
   def createModel(weights: Array[Double], intercept: Double) = {
     val weightsMat = new DoubleMatrix(weights.length + 1, 1, (Array(intercept) ++ weights):_*)
@@ -134,7 +133,7 @@ object RidgeRegressionWithSGD {
       initialWeights: Array[Double])
     : RidgeRegressionModel =
   {
-    new RidgeRegressionWithSGD(stepSize, numIterations, regParam, miniBatchFraction, true).run(
+    new RidgeRegressionWithSGD(stepSize, numIterations, regParam, miniBatchFraction).run(
       input, initialWeights)
   }
 
@@ -157,8 +156,7 @@ object RidgeRegressionWithSGD {
       miniBatchFraction: Double)
     : RidgeRegressionModel =
   {
-    new RidgeRegressionWithSGD(stepSize, numIterations, regParam, miniBatchFraction, true).run(
-      input)
+    new RidgeRegressionWithSGD(stepSize, numIterations, regParam, miniBatchFraction).run(input)
   }
 
   /**
-- 
GitLab