You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/06 03:48:22 UTC

[GitHub] [spark] zhengruifeng commented on a change in pull request #33710: [SPARK-36481][ML] Expose LogisticRegression.setInitialModel, like KMeans et al do

zhengruifeng commented on a change in pull request #33710:
URL: https://github.com/apache/spark/pull/33710#discussion_r702544438



##########
File path: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
##########
@@ -486,7 +486,8 @@ class LogisticRegression @Since("1.2.0") (
 
   private var optInitialModel: Option[LogisticRegressionModel] = None
 
-  private[spark] def setInitialModel(model: LogisticRegressionModel): this.type = {
+  @Since("3.3.0")
+  def setInitialModel(model: LogisticRegressionModel): this.type = {

Review comment:
       Since `model` is not a `Param`, I think we need to document this difference from other params:
   1, `model` is not saved in `MLWritable.save`;
   2, `model` is not passed to the trained model `LogisticRegressionModel`
   
   one case is:
   ```
   val lr = new LogisticRegression().setMaxIter(100).setInitialModel(otherModel)
   lr.save("/tmp/lr")                                           // does not save initial model
   val lr2 = LogisticRegression.load("/tmp/lr")  // does not contains model
   ```
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org