when I am trying to export a random forest graph using the following command:
tree.export_graphviz(rnd_clf, out_file = None, feature_names = X_test[::1])
I receive the following error:
NotFittedError: This RandomForestClassifier instance is not fitted yet.
Call 'fit' with appropriate arguments before using this method.
What I don't understand is why it keeps telling me this, even though I have fitted the random forest classifier using:
rnd_clf = RandomForestClassifier(
n_estimators=120,
criterion='gini',
max_features= None,
max_depth = 14 )
rnd_clf.fit(X_train, y_train)
and it works perfectly fine.