0

I am plotting Validation Curves using the Yellowbrick package here.

I am using a Regressor model, and so naturally, my score of interest is MSE (or neg_mean_squared_error as the actual parameter). The example code in the documentation uses R^2, so there is no need to flip the sign when plotting those Validation curves.

Therefore, I was wondering how to flip the sign for the Validation loss curves? My code reproduced using the Yellowbrick template is here:

import numpy as np

from yellowbrick.datasets import load_energy
from yellowbrick.model_selection import ValidationCurve

from sklearn.tree import DecisionTreeRegressor

# Load a regression dataset
X, y = load_energy()

viz = ValidationCurve(
    DecisionTreeRegressor(), param_name="max_depth",
    param_range=np.arange(1, 11), cv=10, scoring="neg_mean_squared_error"
)

# Fit and show the visualizer
viz.fit(X, y)
viz.show()

Want something like this except flipped since these will be loss curves as opposed to R^2 curves:

enter image description here

Katsu
  • 8,479
  • 3
  • 15
  • 16

0 Answers0