Last active
August 29, 2015 14:04
-
-
Save davidandrzej/ac4abe76c1a5058b05cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> implicit val em = EvaluationMonoid | |
em: EvaluationMonoid.type = EvaluationMonoid$@34f5b235 | |
scala> implicit val mm = mapMonoid[String,Evaluation] | |
mm: scalaz.Monoid[Map[String,Evaluation]] = scalaz.std.MapInstances$$anon$4@13105b09 | |
scala> val dataset1 = Map("modelA" -> Evaluation(3,2), | |
| "modelB" -> Evaluation(4,1)) | |
dataset1: scala.collection.immutable.Map[String,Evaluation] = | |
Map(modelA -> Evaluation(3,2), modelB -> Evaluation(4,1)) | |
scala> val dataset2 = Map("modelA" -> Evaluation(5,4)) | |
dataset2: scala.collection.immutable.Map[String,Evaluation] = | |
Map(modelA -> Evaluation(5,4)) | |
scala> mm.append(dataset1,dataset2) | |
res3: Map[String,Evaluation] = | |
Map(modelA -> Evaluation(8,6), modelB -> Evaluation(4,1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment