--- a/testing2/danube.scala Sat Dec 15 23:58:12 2018 +0000
+++ b/testing2/danube.scala Sun Dec 16 21:43:14 2018 +0000
@@ -77,8 +77,18 @@
}
}
+//
+//val ls = List(("1", "a"), ("2", "a"), ("1", "c"), ("2", "a"), ("1", "c"))
+//
+//val m = groupById(ls, Map())
+//
+//m.getOrElse("1", Nil).count(_ == "c") // => 2
+//m.getOrElse("1", Nil).count(_ == "a") // => 1
+
// test cases
//val ratings_map = groupById(good_ratings, Map())
+//groupById(good_ratings, Map()).get("214")
+//groupById(good_ratings, Map()).toList.minBy(_._2.length)
//val movies_map = movie_names.toMap
//ratings_map.get("414").get.map(movies_map.get(_)) // most prolific recommender with 1227 positive ratings