将多个黄砖图表放入子图排列时遇到问题。标题和图例仅显示最后一个图表。我尝试了多种方法来编写代码,但无法让所有方法都显示图例和标题。我敢肯定,上班很简单。
这是一段代码:
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2,figsize=(14, 10))
viz = FeatureImportances(LinearRegression(), ax=ax1)
viz.fit(X_train, y_train)
viz = LearningCurve(LinearRegression(), scoring='r2',cv=10, ax=ax2)
viz.fit(X_train, y_train)
viz = ResidualsPlot(clf, ax=ax3)
viz.fit(X_train, y_train)
viz = PredictionError(LinearRegression(), ax=ax4)
viz.fit(X_train, y_train)
viz.score(X_test, y_test)
viz.poof()