Github user dbtsai commented on a diff in the pull request:
https://github.com/apache/spark/pull/13796#discussion_r75064097
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
---
@@ -1082,57 +1343,62 @@ private class LogisticCostFun(
fitIntercept: Boolean,
standardization: Boolean,
bcFeaturesStd: Broadcast[Array[Double]],
- regParamL2: Double) extends DiffFunction[BDV[Double]] {
+ regParamL2: Double,
+ multinomial: Boolean) extends DiffFunction[BDV[Double]] {
val featuresStd = bcFeaturesStd.value
override def calculate(coefficients: BDV[Double]): (Double, BDV[Double])
= {
- val numFeatures = featuresStd.length
val coeffs = Vectors.fromBreeze(coefficients)
val bcCoeffs = instances.context.broadcast(coeffs)
- val n = coeffs.size
+ val localFeaturesStd = featuresStd
+ val numFeatures = localFeaturesStd.length
+ val numFeaturesPlusIntercept = if (fitIntercept) numFeatures + 1 else
numFeatures
val logisticAggregator = {
- val seqOp = (c: LogisticAggregator, instance: Instance) =>
c.add(instance)
+ val seqOp = (c: LogisticAggregator, instance: Instance) =>
+ c.add(instance)
--- End diff --
revert this if no change.
---
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]