我试图可视化整个RandomForestClassifier rfclf
export_graphviz(rfclf, out_file='Graphs/rfclfWhole.dot',
feature_names = x.columns,
class_names = y,
rounded = True, proportion = False,
precision = 2, filled = True)
而不是像往常一样为可视化执行以下操作:
export_graphviz(rfclf.estimators_[5], out_file='Graphs/rfclfWhole.dot',
feature_names = x.columns,
class_names = y,
rounded = True, proportion = False,
precision = 2, filled = True)
得到
NotFittedError:不适合此RandomForestClassifier实例 然而。使用此方法之前,请使用适当的参数调用“适合”。
但是我确实打过rfclf.fit