Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/7884#discussion_r38586864
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
---
@@ -833,14 +863,13 @@ private class LogisticCostFun(
val numFeatures = featuresStd.length
val w = Vectors.fromBreeze(weights)
- val logisticAggregator = data.treeAggregate(new LogisticAggregator(w,
numClasses, fitIntercept,
- featuresStd, featuresMean))(
- seqOp = (c, v) => (c, v) match {
- case (aggregator, (label, features)) => aggregator.add(label,
features)
- },
- combOp = (c1, c2) => (c1, c2) match {
- case (aggregator1, aggregator2) => aggregator1.merge(aggregator2)
- })
+ val logisticAggregator = {
+ val combOp = (c1: LogisticAggregator, c2: LogisticAggregator) =>
c1.merge(c2)
+ val seqOp = (c: LogisticAggregator, v: (Double, Double, Vector)) =>
c.add(v._1, v._3, v._2)
--- End diff --
More readable if we define a private case class for weighted instances.
---
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]