glm,formula,ANY,DataFrame-method {SparkR} | R Documentation |
Fits a generalized linear model, similarly to R's glm(). Also see the glmnet package.
## S4 method for signature 'formula,ANY,DataFrame' glm(formula, family = c("gaussian", "binomial"), data, lambda = 0, alpha = 0)
formula |
A symbolic description of the model to be fitted. Currently only a few formula operators are supported, including '~' and '+'. |
family |
Error distribution. "gaussian" -> linear regression, "binomial" -> logistic reg. |
data |
DataFrame for training |
lambda |
Regularization parameter |
alpha |
Elastic-net mixing parameter (see glmnet's documentation for details) |
a fitted MLlib model
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D data(iris)
##D df <- createDataFrame(sqlContext, iris)
##D model <- glm(Sepal_Length ~ Sepal_Width, df)
## End(Not run)