huaxingao opened a new pull request #26489: [SPARK-29876][ML][PYTHON] Add 
__repr__ in Python ML Models
URL: https://github.com/apache/spark/pull/26489
 
 
   ### What changes were proposed in this pull request?
   Add ```__repr__``` in Python ML Models
   
   
   ### Why are the changes needed?
   In Python ML Models, some of them have ```__repr__```, others don't. In the 
doctest, when calling Model.setXXX, some of the Models print out the 
xxxModel... correctly, some of them can't because of lacking the  
```__repr__``` method. For example:
   ```
       >>> gm = GaussianMixture(k=3, tol=0.0001, seed=10)
       >>> model = gm.fit(df)
       >>> model.setPredictionCol("newPrediction")
       GaussianMixture...
   ```
   After the change, the above code will become the following:
   ```
       >>> gm = GaussianMixture(k=3, tol=0.0001, seed=10)
       >>> model = gm.fit(df)
       >>> model.setPredictionCol("newPrediction")
       GaussianMixtureModel...
   ```
   
   
   
   ### Does this PR introduce any user-facing change?
   Yes.
   
   
   
   ### How was this patch tested?
   doctest
   

----------------------------------------------------------------
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