我有以下代码:
print('Training...')
forest = RandomForestClassifier(n_estimators=100)
forest = forest.fit( train_data[0::,1::], train_data[0::,0] )
print('Predicting...')
output = forest.predict(test_data).astype(int)
if sys.version_info >= (3,0,0):
predictions_file = open("myfirstforest.csv", 'w', newline='')
else:
predictions_file = open("myfirstforest.csv", 'wb')
tree.export_graphviz(forest, out_file='tree.dot')
最后一行不起作用,因为forest不包含树。有没有办法生成一个代表分类器校准的点文件?