def test_covtype_memorize(): with timer("Cuda treelearn"): forest = RandomForestClassifier(bootstrap = False) forest.fit(x, y, bfs_threshold = 500000) with timer("Predict"): diff, total = util.test_diff(forest.predict(x), y) print "%s(Wrong)/%s(Total). The error rate is %f." % (diff, total, diff/float(total)) assert diff == 0, "Didn't perfectly memorize, got %d wrong" % diff
def test_digits_memorize(): with timer("Cuda treelearn"): forest = RandomForestClassifier(n_estimators = n_estimators/2, bootstrap = False) forest.fit(x, y) with timer("Predict"): diff, total = util.test_diff(forest.predict(x), y) print "%s (Wrong) / %s (Total). The error rate is %f." % (diff, total, diff/float(total)) assert diff == 0, "Didn't memorize, got %d wrong" % diff
def test_covtype_memorize(): with timer("Cuda treelearn"): forest = RandomForestClassifier(bootstrap = False) forest.fit(x, y, bfs_threshold = 500000) with timer("Predict"): diff, total = util.test_diff(forest.predict(x), y) print("%s(Wrong)/%s(Total). The error rate is %f." % (diff, total, diff/float(total))) assert diff == 0, "Didn't perfectly memorize, got %d wrong" % diff