Could you change my code in this way so as to have these 2 plots alongside, means in 1 row and 2 column (subplot nrows=1, ncols=2) ? Currently I have these charts in 2 separate cells, and I want to have them in 1.
my code: First plot:
from yellowbrick.classifier import (PrecisionRecallCurve)
fig, ax = plt.subplots(figsize=(10, 6))
viz = PrecisionRecallCurve(DecisionTreeClassifier(max_depth=4))
viz.fit(X_train_model_2, y_train_model_2)
print(viz.score(X_test_model_2, y_test_model_2))
viz.ax.set(title="Krzywa precyzja-czułość klasyfikatora drzewa losowego",
xlabel="Czułość",
ylabel="Precyzja")
ax.legend(("Binarna krzywa precyzja-czułość",
"Średnia precyzja = {:0.2f}".format(viz.score(X_test_model_2,y_test_model_2))),
frameon=True,
loc="lower left")
plt.show()
Second plot:
import scikitplot as skplt
fig, ax = plt.subplots(figsize=(10, 6))
y_probas = decision_tree.predict_proba(X_test_model_2)
skplt.metrics.plot_cumulative_gain(y_test_model_2,
y_probas,
ax=ax)
ax.set(title="Krzywa skumulowanych zysków",
xlabel="Odsetek próbek",
ylabel="Zysk")
ax.legend(("Klasa 0",
"Klasa 1",
"Krzywa odniesienia"),
frameon=True,
loc="lower right")
plt.show()