if len(X) != len(y):
raise ValueError(
"Length of x = {len_x}, length of y = {len_y}, while it must be equal.".format(
len_x=len(X), len_y=len(y)
)
)
y_ = check_array(y, ensure_2d=False)
After Change
// )
if y is not None:
len_X = len(X) if not scipy.sparse.issparse(X) else X.shape[0]
if len_X != len(y):
raise ValueError(
"Length of x = {len_x}, length of y = {len_y}, while it must be equal.".format(
len_x=len_X, len_y=len(y)