huaxingao commented on a change in pull request #26838: 
[SPARK-30144][ML][PySpark] Make MultilayerPerceptronClassificationModel extend 
MultilayerPerceptronParams
URL: https://github.com/apache/spark/pull/26838#discussion_r358338918
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala
 ##########
 @@ -247,7 +247,8 @@ class MultilayerPerceptronClassifier @Since("1.5.0") (
     }
     trainer.setStackSize($(blockSize))
     val mlpModel = trainer.train(data)
-    new MultilayerPerceptronClassificationModel(uid, myLayers, 
mlpModel.weights)
+    val model = new MultilayerPerceptronClassificationModel(uid, 
mlpModel.weights)
+    model.setLayers(myLayers)
 
 Review comment:
   The params are set at line 152 in Preditor
   
   ```copyValues(train(casted).setParent(this))``` 
   
   It copies all the params in ```paramMap``` from ```Preditor``` 
(```MultilayerPerceptronClassifier```) to the model. Actually since 
```layers``` is one of the params now, it also sets here. No need to set it 
explicitly. I will remove line 251.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to