You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2016/06/21 17:45:58 UTC

[jira] [Commented] (SPARK-16108) Why is KMeansModel (scala) private?

    [ https://issues.apache.org/jira/browse/SPARK-16108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15342293#comment-15342293 ] 

Sean Owen commented on SPARK-16108:
-----------------------------------

Nit: it's not private, but its constructor is: https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala#L102

> Why is KMeansModel (scala) private?
> -----------------------------------
>
>                 Key: SPARK-16108
>                 URL: https://issues.apache.org/jira/browse/SPARK-16108
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML
>    Affects Versions: 1.6.1
>            Reporter: Florian Golemo
>            Priority: Minor
>              Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Hey guys, 
> I was wondering, in the file KMeans.scala (org/apache/spark/ml/clustering/KMeans.scala), the class KMeansModel is private. But only in Scala, not in Java - why is that, and why would that be a good idea?
> More concretely, imagine I wanted to extend the KMeans class and still be compatible with the API so I can use it in a pipeline. In Scala that's not possible, because I can't override the 'fit' method of KMeans, because that requires me to return a KMeansModel, which I can't instantiate because the constructor of KMeansModel is private.
> If there is no apparent reason we could just make it public, no?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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