I have the following piece of code:
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')
The last line does not work because forest does not contain a tree. Is there a way to generate a dot file representing the calibration of the classifier ?