change the y axis label

30 views Asked by At

I am trying to plot the learning curve using yellowbrick library (https://www.scikit-yb.org/en/latest/api/model_selection/learning_curve.html). How can I change the label for the y axis? Thanks.


 X_normalized, y_for_normalized = scaled_df[[ "Part's Z-Height (mm)","Part's Solid Volume (cm^3)","Material's Density (g/cm^3)","Layer Height (mm)","Infill Density (%)","Printing/Scanning Speed (mm/s)","Part's Orientation (Support's volume) (cm^3)"]], scaled_df [["Climate change (kg CO2 eq.)","Climate change, incl biogenic carbon (kg CO2 eq.)","Fine Particulate Matter Formation (kg PM2.5 eq.)","Fossil depletion (kg oil eq.)","Freshwater Consumption (m^3)","Freshwater ecotoxicity (kg 1,4-DB eq.)","Freshwater Eutrophication (kg P eq.)","Human toxicity, cancer (kg 1,4-DB eq.)","Human toxicity, non-cancer (kg 1,4-DB eq.)","Ionizing Radiation (Bq. C-60 eq. to air)","Land use (Annual crop eq. yr)","Marine ecotoxicity (kg 1,4-DB eq.)","Marine Eutrophication (kg N eq.)","Metal depletion (kg Cu eq.)","Photochemical Ozone Formation, Ecosystem (kg NOx eq.)","Photochemical Ozone Formation, Human Health (kg NOx eq.)","Stratospheric Ozone Depletion (kg CFC-11 eq.)","Terrestrial Acidification (kg SO2 eq.)","Terrestrial ecotoxicity (kg 1,4-DB eq.)"]]

x_train, x_test, y_train, y_test = train_test_split(X_normalized, y_for_normalized, test_size=0.20,random_state=0)


lin_regressor = LinearRegression()

# pass the order of your polynomial here  
poly = PolynomialFeatures(1)

# convert to be used further to linear regression
X_transform = poly.fit_transform(x_train)

# fit this to Linear Regressor
linear_regg=lin_regressor.fit(X_transform,y_train) 

linear_regg.coef_

from yellowbrick.model_selection import (
    learning_curve,
    validation_curve,
    cv_scores)

learning_curve(
    estimator=lin_regressor,
    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',
    )

Result

0

There are 0 answers