@@ -25,7 +25,7 @@ import breeze.optimize.{CachedDiffFunction, DiffFunction}
2525
2626import org .apache .spark .annotation .AlphaComponent
2727import org .apache .spark .ml .param .{Params , ParamMap }
28- import org .apache .spark .ml .param .shared .{HasConvergenceTol , HasElasticNetParam , HasMaxIter ,
28+ import org .apache .spark .ml .param .shared .{HasTol , HasElasticNetParam , HasMaxIter ,
2929 HasRegParam }
3030import org .apache .spark .mllib .stat .MultivariateOnlineSummarizer
3131import org .apache .spark .mllib .linalg .{Vector , Vectors }
@@ -41,7 +41,7 @@ import org.apache.spark.Logging
4141 * Params for linear regression.
4242 */
4343private [regression] trait LinearRegressionParams extends RegressorParams
44- with HasRegParam with HasElasticNetParam with HasMaxIter with HasConvergenceTol
44+ with HasRegParam with HasElasticNetParam with HasMaxIter with HasTol
4545
4646/**
4747 * :: AlphaComponent ::
@@ -94,8 +94,8 @@ class LinearRegression extends Regressor[Vector, LinearRegression, LinearRegress
9494 * Default is 1E-6.
9595 * @group setParam
9696 */
97- def setTol (value : Double ): this .type = set(convergenceTol , value)
98- setDefault(convergenceTol -> 1E-6 )
97+ def setTol (value : Double ): this .type = set(tol , value)
98+ setDefault(tol -> 1E-6 )
9999
100100 override protected def train (dataset : DataFrame , paramMap : ParamMap ): LinearRegressionModel = {
101101 // Extract columns from data. If dataset is persisted, do not persist instances.
@@ -144,10 +144,10 @@ class LinearRegression extends Regressor[Vector, LinearRegression, LinearRegress
144144 featuresStd, featuresMean, effectiveL2RegParam)
145145
146146 val optimizer = if (paramMap(elasticNetParam) == 0.0 || effectiveRegParam == 0.0 ) {
147- new BreezeLBFGS [BDV [Double ]](paramMap(maxIter), 10 , paramMap(convergenceTol ))
147+ new BreezeLBFGS [BDV [Double ]](paramMap(maxIter), 10 , paramMap(tol ))
148148 } else {
149149 new BreezeOWLQN [Int , BDV [Double ]](paramMap(maxIter), 10 , effectiveL1RegParam,
150- paramMap(convergenceTol ))
150+ paramMap(tol ))
151151 }
152152
153153 val initialWeights = Vectors .zeros(numFeatures)
0 commit comments