diff options
author | wm624@hotmail.com <wm624@hotmail.com> | 2017-04-24 23:43:06 +0800 |
---|---|---|
committer | Yanbo Liang <ybliang8@gmail.com> | 2017-04-24 23:43:06 +0800 |
commit | 90264aced7cfdf265636517b91e5d1324fe60112 (patch) | |
tree | f95eb8fd71d293be3c1357d9c08dd5ed1d5cb6d3 | |
parent | 776a2c0e91dfea170ea1c489118e1d42c4121f35 (diff) | |
download | spark-90264aced7cfdf265636517b91e5d1324fe60112.tar.gz spark-90264aced7cfdf265636517b91e5d1324fe60112.tar.bz2 spark-90264aced7cfdf265636517b91e5d1324fe60112.zip |
[SPARK-18901][ML] Require in LR LogisticAggregator is redundant
## What changes were proposed in this pull request?
In MultivariateOnlineSummarizer,
`add` and `merge` have check for weights and feature sizes. The checks in LR are redundant, which are removed from this PR.
## How was this patch tested?
Existing tests.
Author: wm624@hotmail.com <wm624@hotmail.com>
Closes #17478 from wangmiao1981/logit.
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala b/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala index bc8154692e..44b3478e0c 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala @@ -1571,9 +1571,6 @@ private class LogisticAggregator( */ def add(instance: Instance): this.type = { instance match { case Instance(label, weight, features) => - require(numFeatures == features.size, s"Dimensions mismatch when adding new instance." + - s" Expecting $numFeatures but got ${features.size}.") - require(weight >= 0.0, s"instance weight, $weight has to be >= 0.0") if (weight == 0.0) return this @@ -1596,8 +1593,6 @@ private class LogisticAggregator( * @return This LogisticAggregator object. */ def merge(other: LogisticAggregator): this.type = { - require(numFeatures == other.numFeatures, s"Dimensions mismatch when merging with another " + - s"LogisticAggregator. Expecting $numFeatures but got ${other.numFeatures}.") if (other.weightSum != 0.0) { weightSum += other.weightSum |