-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17241][SparkR][MLlib] SparkR spark.glm should have configurable regularization parameter #14856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-17241][SparkR][MLlib] SparkR spark.glm should have configurable regularization parameter #14856
Changes from 1 commit
6417049
c8bdd3b
492f29f
dd7cb82
39820a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,10 @@ test_that("spark.glm summary", { | |
| expect_match(out[2], "Deviance Residuals:") | ||
| expect_true(any(grepl("AIC: 59.22", out))) | ||
|
|
||
| # Test spark.glm works with regularization parameter | ||
| regStats <- summary(spark.glm(training, Sepal_Width ~ Sepal_Length + Species, regParam = 0.3)) | ||
| expect_equal(regStats$aic, 136.7, tolerance = 1e-3) | ||
|
||
|
|
||
| # binomial family | ||
| df <- suppressWarnings(createDataFrame(iris)) | ||
| training <- df[df$Species %in% c("versicolor", "virginica"), ] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can add that to the end of the argument list so that it doesn't break the existing calls to the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the
fit()method of the wrapper, as long as the parameter order matches, it's ok.I've tested it already in R terminal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If say an R user call the function by
spark.glm(df, label ~ feature, gaussian, 1e-6, 25). This will break their code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 - we should try to avoid breaking existing caller