I am using yellowbrick to generate my learning curve. How can I change the location of my legend? I have tried the following with no luck:
plt.legend(loc="upper left")
from yellowbrick.model_selection import (
learning_curve,
validation_curve,
cv_scores)
plt.rcParams['figure.figsize'] = [10, 5]
plt.legend(loc="upper left")
#plt.gca().set_ylim(bottom=0.5) # set the y axis lower bound
fig2 = plt.gcf()
learning_curve(
estimator=mlp_new,
X=x_train,
y=y_train,
cv=4,
train_sizes=np.linspace(0.1,1.0,5),
n_jobs=1,
random_state=0,
scoring='r2',
)
#ax.set_ylabel("custom x label")
plt.show()
plt.draw()
fig2.savefig('for DNN.jpeg',bbox_inches='tight', dpi=600)