File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
mllib/src/main/scala/org/apache/spark/ml/r Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,13 @@ private[r] class LogisticRegressionWrapper private (
4040 private val lrModel : LogisticRegressionModel =
4141 pipeline.stages(1 ).asInstanceOf [LogisticRegressionModel ]
4242
43- val rFeatures : Array [String ] = if (lrModel.getFitIntercept) {
43+ lazy val rFeatures : Array [String ] = if (lrModel.getFitIntercept) {
4444 Array (" (Intercept)" ) ++ features
4545 } else {
4646 features
4747 }
4848
49- val rCoefficients : Array [Double ] = {
49+ lazy val rCoefficients : Array [Double ] = {
5050 val numRows = lrModel.coefficientMatrix.numRows
5151 val numCols = lrModel.coefficientMatrix.numCols
5252 val numColsWithIntercept = if (lrModel.getFitIntercept) numCols + 1 else numCols
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ private[r] class MultilayerPerceptronClassifierWrapper private (
3636
3737 import MultilayerPerceptronClassifierWrapper ._
3838
39- val mlpModel : MultilayerPerceptronClassificationModel =
39+ private val mlpModel : MultilayerPerceptronClassificationModel =
4040 pipeline.stages(1 ).asInstanceOf [MultilayerPerceptronClassificationModel ]
4141
42- val weights : Array [Double ] = mlpModel.weights.toArray
43- val layers : Array [Int ] = mlpModel.layers
42+ lazy val weights : Array [Double ] = mlpModel.weights.toArray
43+ lazy val layers : Array [Int ] = mlpModel.layers
4444
4545 def transform (dataset : Dataset [_]): DataFrame = {
4646 pipeline.transform(dataset)
You can’t perform that action at this time.
0 commit comments