Skip to content
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-13132] [MLlib] cache standardization param value in LogisticRegression #11027

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,13 @@ class LogisticRegression @Since("1.2.0") (
val optimizer = if ($(elasticNetParam) == 0.0 || $(regParam) == 0.0) {
new BreezeLBFGS[BDV[Double]]($(maxIter), 10, $(tol))
} else {
val standardizationParam = $(standardization)
def regParamL1Fun = (index: Int) => {
// Remove the L1 penalization on the intercept
if (index == numFeatures) {
0.0
} else {
if ($(standardization)) {
if (standardizationParam) {
regParamL1
} else {
// If `standardization` is false, we still standardize the data
Expand Down
4 changes: 3 additions & 1 deletion mllib/src/main/scala/org/apache/spark/ml/param/params.scala
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class Param[T](val parent: String, val name: String, val doc: String, val isVali
}
}

override final def toString: String = s"${parent}__$name"
private[this] val stringRepresentation = s"${parent}__$name"

override final def toString: String = stringRepresentation

override final def hashCode: Int = toString.##

Expand Down