Skip to content

Improper error message in RidgeCV regarding null alpha #18994

@kabragaurav

Description

@kabragaurav

I am using Google Colab with this code:
from sklearn.linear_model import RidgeCV
import numpy as np
r_cv = RidgeCV(alphas=[round(float(x),1) for x in np.linspace(0,1,10)])

model = r_cv.fit(x_train, y_train)
model.alpha_

But the error coming is inappropriate:
ValueError: alphas must be positive. Got [0. 0.1 0.2 0.3 0.4 0.6 0.7 0.8 0.9 1. ] containing some negative or null value instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EasyWell-defined and straightforward way to resolvegood first issueEasy with clear instructions to resolvehelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions