示例#1
0
def successful_example():
    forest = RandomForest("mushrooms",
                          n_boostrap=50,
                          n_features=10,
                          test_size=0.2,
                          n_trees=10,
                          tree_max_depth=10
                          )

    forest.test_model()
    forest.print_forest()
    print("Successful forest accuracy " + str(forest.accuracy * 100) + "%")
示例#2
0
def fail_example():
    forest = RandomForest("diabetes",
                          n_boostrap=50,
                          n_features=8,
                          test_size=0.2,
                          n_trees=20,
                          tree_max_depth=10
                          )

    forest.test_model()
    forest.print_forest()
    print("Unsuccessful forest accuracy " + str(forest.accuracy * 100) + "%")