intial commit (forked from private repo)
This commit is contained in:
12
extracted_cells/cell13.py
Normal file
12
extracted_cells/cell13.py
Normal file
@ -0,0 +1,12 @@
|
||||
# Visualisierung eines einzelnen Entscheidungsbaums aus dem Random Forest
|
||||
plt.figure(figsize=(25, 12))
|
||||
tree_to_plot = rf_model.estimators_[0] # Ersten Baum aus dem Forest auswählen
|
||||
plot_tree(tree_to_plot,
|
||||
feature_names=X_train.columns,
|
||||
class_names=['<=50K', '>50K'],
|
||||
filled=True,
|
||||
rounded=True,
|
||||
fontsize=10,
|
||||
max_depth=3)
|
||||
plt.savefig('output/Random_Forest_Tree_Example.png', dpi=300)
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user