Skip to content

Commit

Permalink
Putting the if/else if statements in brackets.
Browse files Browse the repository at this point in the history
  • Loading branch information
miccagiann committed Aug 2, 2014
1 parent fed8eaa commit 8dcb888
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,14 @@ class PythonMLLibAPI extends Serializable {
.setNumIterations(numIterations)
.setRegParam(regParam)
.setStepSize(stepSize)
if (regType == "l2")
if (regType == "l2") {
lrAlg.optimizer.setUpdater(new SquaredL2Updater)
else if (regType == "l1")
} else if (regType == "l1") {
lrAlg.optimizer.setUpdater(new L1Updater)
else if (regType != "none")
} else if (regType != "none") {
throw new java.lang.IllegalArgumentException("Invalid value for 'regType' parameter."
+ " Can only be initialized using the following string values: [l1, l2, none].")
}
trainRegressionModel(
(data, initialWeights) =>
lrAlg.run(data, initialWeights),
Expand Down

0 comments on commit 8dcb888

Please sign in to comment.