Skip to content

Commit

Permalink
Iter
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturoAmorQ committed Mar 20, 2024
1 parent 734b4b8 commit 62e6ef0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python_scripts/trees_sol_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@
import numpy as np
from matplotlib import cm

classes = np.unique(tree.classes_)
_, axs = plt.subplots(ncols=3, nrows=1, sharey=True, figsize=(12, 5))
plt.suptitle("Predicted probabilities for decision tree model", y=1.05)
plt.subplots_adjust(bottom=0.45)

for idx, class_of_interest in enumerate(np.unique(tree.classes_)):
for idx, class_of_interest in enumerate(classes):
axs[idx].set_title(f"Class {class_of_interest}")
disp = DecisionBoundaryDisplay.from_estimator(
tree,
Expand All @@ -179,9 +180,7 @@

ax = plt.axes([0.15, 0.14, 0.7, 0.05])
plt.colorbar(
cm.ScalarMappable(norm=None, cmap="viridis"),
cax=ax,
orientation="horizontal",
cm.ScalarMappable(cmap="viridis"), cax=ax, orientation="horizontal"
)
_ = plt.title("Probability")

Expand Down

0 comments on commit 62e6ef0

Please sign in to comment.