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

Alexander Albul commented on SPARK-2495:
----------------------------------------

Hi Meng,

Here is the list of models that potentially can can be created by used "by 
hands":

* LogisticRegressionModel
* NaiveBayesModel
* SVMModel
* KMeansModel
* MatrixFactorizationModel
* LassoModel
* LinearRegressionModel
* RidgeRegressionModel

I propose to open all of them.
Even if you didn't decide yet the final form of NaiveBayesModel parameters, 
this should not reflect model's constructor visibility IMHO. 
We can make it visible and mark with DeveloperAPI annotation for example.
Anyway, i propose to change constructor visibility at least for all models 
except NaiveBayesModel

> Ability to re-create ML models
> ------------------------------
>
>                 Key: SPARK-2495
>                 URL: https://issues.apache.org/jira/browse/SPARK-2495
>             Project: Spark
>          Issue Type: Improvement
>          Components: MLlib
>    Affects Versions: 1.0.1
>            Reporter: Alexander Albul
>            Assignee: Alexander Albul
>
> Hi everyone.
> Previously (prior to Spark 1.0) we was working with MLib like this:
> 1) Calculate model (costly operation)
> 2) Take model and collect it's fields like weights, intercept e.t.c.
> 3) Store model somewhere in our format
> 4) Do predictions by loading model attributes, creating new model and 
> predicting using it.
> Now i see that model's constructors have *private* modifier and cannot be 
> created from outside.
> If you want to hide implementation details and keep this constructor as 
> "developer api", why not to create at least method, which will take weights, 
> intercept (for example) an materialize that model?
> A good example of model that i am talking about is: *LinearRegressionModel*
> I know that *LinearRegressionWithSGD* class have *createModel* method but the 
> problem is that it have *protected* modifier as well.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to