def getPredictions(self): if 'predictions' in self.cache: return self.cache['predictions'] U,S,V = self.getSVD() predictions = divisi2.reconstruct(U,S,V) self.cache['predictions'] = predictions return predictions
def test_all_norm(): matrix = divisi2.network.conceptnet_matrix('en') U, S, V = matrix.normalize_all().svd(k=100) rec = divisi2.reconstruct(U, S, V) correct, total, accuracy = rec.evaluate_assertions('data:eval/usertest_data.pickle') print "accuracy =", accuracy assert accuracy > 0.7 return accuracy
def test_all_norm(): matrix = divisi2.network.conceptnet_matrix('en') U, S, V = matrix.normalize_all().svd(k=100) rec = divisi2.reconstruct(U, S, V) correct, total, accuracy = rec.evaluate_assertions( 'data:eval/usertest_data.pickle') print "accuracy =", accuracy assert accuracy > 0.7 return accuracy