def test(var, k, n, m, s, p): data, labels = kblobs(var, k, n) hidlabs = myssl.hide_labels(labels, p) agr = myssl.SSLSolver() predlabels, _, _ = agr.fit(data, hidlabs, m, s) print(labels[:20]) print(predlabels[:20]) score = 0 for i in range(n): if labels[i] == predlabels[i]: score += 1 print("Score is {} out of {}".format(score, n))
def test(m, s, p): data, labels = train_data_reduced[:1000, :], train_labels[:1000] + 1 hidlabs = myssl.hide_labels(labels, p) agr = myssl.SSLSolver() predlabels, _, _ = agr.fit(data, hidlabs, m, s) print(labels[:20]) print(predlabels[:20]) score = 0 for i in range(len(labels)): if labels[i] == predlabels[i]: score += 1 print("Score is {} out of {}".format(score, len(labels)))