I produced a lift curve of answers predicted through 2 models: logistic regression and decision tree. I get 2 separate plots on two separate graphs. I need a single graph depicting both the plots. How to do that?
import scikitplot as skplt
log_y_probas = logmodel.predict_proba(X_test)
dec_y_probas = DecisionTreeModel.predict_proba(X_test);
skplt.metrics.plot_lift_curve(y_test,log_y_probas);
skplt.metrics.plot_lift_curve(y_test,dec_y_probas);
plt.show();
I receive two different plots on two different graphs. I need both the plots on the single graph. What should I do? Or should I use a different Python library somehow?
In Python, there is no need to end statements with semicolons.
Anyway, each call to plot_lift_curve
returns an Axes
object if the ax
parameter is not specified. You can use that to plot both curves on the same Axes
:
ax = skplt.metrics.plot_lift_curve(y_test, log_y_probas)
skplt.metrics.plot_lift_curve(y_test, dec_y_probas, ax=ax)
plt.show()