Github user hhbyyh commented on a diff in the pull request:
https://github.com/apache/spark/pull/18315#discussion_r134104799
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala ---
@@ -219,8 +219,17 @@ class LinearSVC @Since("2.2.0") (
val featuresStd = summarizer.variance.toArray.map(math.sqrt)
val regParamL2 = $(regParam)
val bcFeaturesStd = instances.context.broadcast(featuresStd)
- val costFun = new LinearSVCCostFun(instances, $(fitIntercept),
- $(standardization), bcFeaturesStd, regParamL2, $(aggregationDepth))
+ val regularization = if (regParamL2 != 0.0) {
+ val shouldApply = (idx: Int) => idx >= 0 && idx < numFeatures
+ Some(new L2Regularization(regParamL2, shouldApply,
+ if ($(standardization)) None else Some(featuresStd)))
--- End diff --
Sure. Will change it to function
---
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]