Skip to content

Commit

Permalink
style fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed May 26, 2015
1 parent 08589f5 commit f40c401
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,16 @@ class LogisticRegression(override val uid: String)
this
}

/** Validate the initial weights, return an Option, if not the expected size return None and log */
/** Validate the initial weights, return an Option, if not the expected size return None
* and log a warning.
*/
private def validateWeights(vectorOpt: Option[Vector], numFeatures: Int): Option[Vector] = {
vectorOpt.flatMap(vec =>
if (vec.size == numFeatures) {
Some(vec)
} else {
logWarning(s"""Initial weights provided (${vec})did not match the expected size ${numFeatures}""")
logWarning(
s"""Initial weights provided (${vec})did not match the expected size ${numFeatures}""")
None
})
}
Expand Down

0 comments on commit f40c401

Please sign in to comment.