Skip to content

Instantly share code, notes, and snippets.

@zeryx
Created January 17, 2017 21:34
Show Gist options
  • Save zeryx/312140857c97c607d3ce96d74ccc5e61 to your computer and use it in GitHub Desktop.
Save zeryx/312140857c97c607d3ce96d74ccc5e61 to your computer and use it in GitHub Desktop.
val formattedPredictions: List[Option[String]] = predictions.map(_.classPredictions.headOption.map(_.prediction))
val formattedLabels: List[Option[String]] = data.map(_.label)
val (guesses, truths): (List[String], List[String]) = (
for {
(guess, truth) <- formattedPredictions zip formattedLabels
realGuess <- guess
realTruth <- truth
}yield(realGuess, realTruth)
).unzip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment