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

    https://github.com/apache/spark/pull/17032#discussion_r102899614
  
    --- Diff: examples/src/main/r/ml/glm.R ---
    @@ -25,12 +25,12 @@ library(SparkR)
     sparkR.session(appName = "SparkR-ML-glm-example")
     
     # $example on$
    -t <- as.data.frame(Titanic)
    -training <- createDataFrame(t)
    +training <- 
read.df("data/mllib/sample_multiclass_classification_data.txt", source = 
"libsvm")
     # Fit a generalized linear model of family "gaussian" with spark.glm
    -gaussianDF <- training
    -gaussianTestDF <- training
    -gaussianGLM <- spark.glm(gaussianDF, Freq ~ Sex + Age, family = "gaussian")
    +set.seed(2)
    +gaussianDF <- sample(training, TRUE, 0.7)
    +gaussianTestDF <- sample(training, TRUE, 0.3)
    --- End diff --
    
    `sample` could duplicate the same row in both training and test set.
    I think we should use randomSplit instead.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to