Skip to content

Commit b726cf0

Browse files
committed
tweaked data to have different users for actions
1 parent 94a56fa commit b726cf0

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

bin/CooccurrenceDriver.mscala

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,21 @@ object CooccurrenceDriver extends App {
8585
existingRowIDs = userDictionary)
8686
userDictionary.putAll(action.rowIDs)
8787
actions = actions :+ (actionDescription._1, action) // put the name in the tuple with the indexedDataset
88-
println("\n\n\nRead in action " + actionDescription._1 +", which has " + action.matrix.nrow.toString + " rows")
89-
println("actions has " + actions.length + " elements in it.\n\n\n")
9088
}
9189

9290
// After all actions are read in the userDictonary will contain every user seen, even if they may not have
9391
// taken all actions . Now we adjust the row rank of all IndxedDataset's to have this number of rows
9492
// Note: this is very important or the cooccurrence calc may fail
9593
val numUsers = userDictionary.size() // one more than the cardinality
96-
println("\n\nTotal number of users for all actions = " + numUsers + "\n\n")
94+
println("Total number of users for all actions = " + numUsers)
9795
val resizedNameActionPairs = actions.map { a =>
9896
println(a._1 + " indicator matrix:")
99-
println("Number of rows for matrix = " + a._2.matrix.nrow )
100-
println("Number of columns for matrix = " + a._2.matrix.ncol )
97+
println(" Number of rows for matrix = " + a._2.matrix.nrow )
98+
println(" Number of columns for matrix = " + a._2.matrix.ncol )
10199
val resizedMatrix = a._2.create(a._2.matrix, userDictionary, a._2.columnIDs).newRowCardinality(numUsers)
102-
println(a._1 + " indicator matrix:")
103-
println("Number of rows after resize = " + resizedMatrix.matrix.nrow )
104-
println("Number of columns after resize = " + resizedMatrix.matrix.ncol )
100+
println(" Number of rows after resize = " + resizedMatrix.matrix.nrow )
105101
(a._1, resizedMatrix)
106102
}
107-
println("\n\n")
108103
resizedNameActionPairs
109104
}
110105

data/category.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ u2,tablets
77
u2,apple
88
u3,microsoft
99
u3,tablets
10-
u4,samsung
11-
u4,apple
10+
u5,samsung
11+
u5,apple

0 commit comments

Comments
 (0)