Skip to content

Commit c1eaca9

Browse files
committed
change private and lazy
1 parent 8c911ad commit c1eaca9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mllib/src/main/scala/org/apache/spark/ml/r/LogisticRegressionWrapper.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

mllib/src/main/scala/org/apache/spark/ml/r/MultilayerPerceptronClassifierWrapper.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)