@@ -184,6 +184,8 @@ predict_internal <- function(object, newData) {
184184# ' This can be a character string naming a family function, a family function or
185185# ' the result of a call to a family function. Refer R family at
186186# ' \url{https://stat.ethz.ch/R-manual/R-devel/library/stats/html/family.html}.
187+ # ' Currently these families are supported: \code{binomial}, \code{gaussian},
188+ # ' \code{Gamma}, and \code{poisson}.
187189# ' @param tol positive convergence tolerance of iterations.
188190# ' @param maxIter integer giving the maximal number of IRLS iterations.
189191# ' @param weightCol the weight column name. If this is not set or \code{NULL}, we treat all instance
@@ -236,8 +238,9 @@ setMethod("spark.glm", signature(data = "SparkDataFrame", formula = "formula"),
236238 weightCol <- " "
237239 }
238240
241+ # For known families, Gamma is upper-cased
239242 jobj <- callJStatic(" org.apache.spark.ml.r.GeneralizedLinearRegressionWrapper" ,
240- " fit" , formula , data @ sdf , family $ family , family $ link ,
243+ " fit" , formula , data @ sdf , tolower( family $ family ) , family $ link ,
241244 tol , as.integer(maxIter ), as.character(weightCol ), regParam )
242245 new(" GeneralizedLinearRegressionModel" , jobj = jobj )
243246 })
@@ -252,6 +255,8 @@ setMethod("spark.glm", signature(data = "SparkDataFrame", formula = "formula"),
252255# ' This can be a character string naming a family function, a family function or
253256# ' the result of a call to a family function. Refer R family at
254257# ' \url{https://stat.ethz.ch/R-manual/R-devel/library/stats/html/family.html}.
258+ # ' Currently these families are supported: \code{binomial}, \code{gaussian},
259+ # ' \code{Gamma}, and \code{poisson}.
255260# ' @param weightCol the weight column name. If this is not set or \code{NULL}, we treat all instance
256261# ' weights as 1.0.
257262# ' @param epsilon positive convergence tolerance of iterations.
0 commit comments