Github user JeremyNixon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13000#discussion_r63272738
  
    --- Diff: examples/src/main/r/ml.R ---
    @@ -25,30 +25,102 @@ library(SparkR)
     sc <- sparkR.init(appName="SparkR-ML-example")
     sqlContext <- sparkRSQL.init(sc)
     
    -# Train GLM of family 'gaussian'
    +############################ spark.glm and glm 
##############################################
    +
    +# Fit a generalized linear model with spark.glm
     training1 <- suppressWarnings(createDataFrame(sqlContext, iris))
     test1 <- training1
    -model1 <- glm(Sepal_Length ~ Sepal_Width + Species, training1, family = 
"gaussian")
    +model1 <- spark.glm(training1, Sepal_Length ~ Sepal_Width + Species, 
family = "gaussian")
     
     # Model summary
     summary(model1)
    --- End diff --
    
    For user readability, it would be great if the models were given names that 
aligned with their algorithm - something like glmModel, naiveBayesModel, that 
makes it clear which model corresponds to which algorithm. For the predictions 
the same change may be helpful for knowing at a glance which variables 
correspond to their outputs. In the MLlib docs the examples are cleanly 
separated from one another so that there's no ambiguity, but as these are in a 
large contiguous file it may make sense to disambiguate things. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to