I am getting a compile time error with the following code:
val bestModel = model
val bestEvals: List[Double] = null
... <code, including code that initializes bestEvals> ...
(bestModel, bestEvals) = if (allAgreeBetter)
(updatedModel, currentEvals.map {case (eval, _) => eval}.toList)
else
(bestModel, bestEvals)
The error is (are):
Error:(203, 34) ';' expected but '=' found.
(bestModel, bestEvals) = if (allAgreeBetter)
Error:(205, 11) ';' expected but 'else' found.
else
What did I miss? If I take out this statement, the code compiles and runs fine, so the problem is specifically in this statement.