summaryrefslogtreecommitdiff
path: root/co-purchase-analysis/src/main/scala/Main.scala
diff options
context:
space:
mode:
Diffstat (limited to 'co-purchase-analysis/src/main/scala/Main.scala')
-rw-r--r--co-purchase-analysis/src/main/scala/Main.scala9
1 files changed, 0 insertions, 9 deletions
diff --git a/co-purchase-analysis/src/main/scala/Main.scala b/co-purchase-analysis/src/main/scala/Main.scala
index a55be03..a12c850 100644
--- a/co-purchase-analysis/src/main/scala/Main.scala
+++ b/co-purchase-analysis/src/main/scala/Main.scala
@@ -114,15 +114,6 @@ object CoPurchaseAnalysis {
ProductPair(Math.min(p1, p2), Math.max(p1, p2)) -> 1
}
}
- .foreach(println)
- data
- .groupBy(_.orderId)
- .flatMap { case (_, orders) =>
- orders.map(_.productId).toSeq.sorted.combinations(2).map {
- case List(p1, p2) =>
- ProductPair(Math.min(p1, p2), Math.max(p1, p2)) -> 1
- }
- }
.reduceByKey(_ + _)
.map { case (ProductPair(product1, product2), count) =>
s"${product1},${product2},${count}"