Advertisement
Guest User

Untitled

a guest
Feb 11th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.47 KB | None | 0 0
  1. val clicks = loadUserItem(site, args.datasetSize(), DateTime.now())
  2.     // The item space here is always going to be small. Shooting it across the network will be slow. So I keep it local.
  3.     val items_stats = clicks.groupBy(i => i._2).map(i => i._1 -> i._2.toList.distinct.size.toDouble).collect().toMap
  4.     val update_clicks = clicks.map(click => (click._1, click._2, items_stats.get(click._2))).filter(entry => entry._3.getOrElse(0d) > 25d).map(entry =>entry._1 -> entry._2 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement