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

    https://github.com/apache/spark/pull/16729#discussion_r105567727
  
    --- Diff: R/pkg/R/mllib_regression.R ---
    @@ -84,14 +93,25 @@ setClass("IsotonicRegressionModel", representation(jobj 
= "jobj"))
     #' # can also read back the saved model and print
     #' savedModel <- read.ml(path)
     #' summary(savedModel)
    +#'
    +#' # fit tweedie model
    +#' model <- spark.glm(df, Freq ~ Sex + Age, family = "tweedie",
    +#'                    variancePower = 1.2, linkPower = 0)
    +#' summary(model)
     #' }
     #' @note spark.glm since 2.0.0
     #' @seealso \link{glm}, \link{read.ml}
     setMethod("spark.glm", signature(data = "SparkDataFrame", formula = 
"formula"),
               function(data, formula, family = gaussian, tol = 1e-6, maxIter = 
25, weightCol = NULL,
    -                   regParam = 0.0) {
    +                   regParam = 0.0, variancePower = 0.0, linkPower = 1.0 - 
variancePower) {
    +
                 if (is.character(family)) {
    -              family <- get(family, mode = "function", envir = 
parent.frame())
    +              # Handle when family = "tweedie"
    +              if (tolower(family) == "tweedie") {
    +                family <- list(family = "tweedie", link = "linkNotUsed")
    --- End diff --
    
    nit: I think you can set link = NULL


---
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