def testModelSelect(self): m = 50 n = 20 k = 5 u = 0.1 w = 1-u X = SparseUtils.generateSparseBinaryMatrix((m, n), k, w) lmbda = 0.1 gamma = 0.01 learner = CLiMF(k, lmbda, gamma) learner.max_iters = 10 learner.modelSelect(X)
def testLearnModel(self): m = 50 n = 20 k = 5 u = 0.1 w = 1-u X = SparseUtils.generateSparseBinaryMatrix((m, n), k, w) lmbda = 0.1 gamma = 0.01 learner = CLiMF(k, lmbda, gamma) learner.max_iters = 50 learner.learnModel(X) Z = learner.predict(n) #Bit weird that all rows are the same print(Z)