spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiva...@apache.org
Subject spark git commit: [SPARK-10760] [SPARKR] SparkR glm: the documentation in examples - family argument is missing
Date Fri, 25 Sep 2015 18:55:15 GMT
Repository: spark
Updated Branches:
  refs/heads/master 922338812 -> 6fcee906d


[SPARK-10760] [SPARKR] SparkR glm: the documentation in examples - family argument is missing

Hi everyone,

Since the family argument is required for the glm function, the execution of:

model <- glm(Sepal_Length ~ Sepal_Width, df)

is failing.

I've fixed the documentation by adding the family argument and also added the summay(model)
which will show the coefficients for the model.

Thanks,
Narine

Author: Narine Kokhlikyan <narine.kokhlikyan@gmail.com>

Closes #8870 from NarineK/sparkrml.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6fcee906
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6fcee906
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6fcee906

Branch: refs/heads/master
Commit: 6fcee906d2afb5d5c3c49e0a669637a87e82b910
Parents: 9223388
Author: Narine Kokhlikyan <narine.kokhlikyan@gmail.com>
Authored: Fri Sep 25 11:55:08 2015 -0700
Committer: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
Committed: Fri Sep 25 11:55:08 2015 -0700

----------------------------------------------------------------------
 R/pkg/R/mllib.R | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6fcee906/R/pkg/R/mllib.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/mllib.R b/R/pkg/R/mllib.R
index 474ada5..cd00bbb 100644
--- a/R/pkg/R/mllib.R
+++ b/R/pkg/R/mllib.R
@@ -41,7 +41,8 @@ setClass("PipelineModel", representation(model = "jobj"))
 #' sqlContext <- sparkRSQL.init(sc)
 #' data(iris)
 #' df <- createDataFrame(sqlContext, iris)
-#' model <- glm(Sepal_Length ~ Sepal_Width, df)
+#' model <- glm(Sepal_Length ~ Sepal_Width, df, family="gaussian")
+#' summary(model)
 #'}
 setMethod("glm", signature(formula = "formula", family = "ANY", data = "DataFrame"),
           function(formula, family = c("gaussian", "binomial"), data, lambda = 0, alpha =
0) {


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


Mime
View raw message