Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/5249#discussion_r27498866
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala
---
@@ -145,13 +135,20 @@ class LogisticRegressionModel (
*/
var bestClass = 0
var maxMargin = 0.0
- var i = 0
- while(i < margins.size) {
- if (margins(i) > maxMargin) {
- maxMargin = margins(i)
+ val withBias = if (dataMatrix.size + 1 == dataWithBiasSize) true
else false
--- End diff --
Ah, no, my point is much simpler, just saying that `if (x) true else false`
is equivalent to the simpler expression `x`. I'm not questioning the boolean
expression itself.
---
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]