ValueError: x and y must be the same size

Print X_train shape. What do you see? I’d bet X_train is 2d (matrix with a single column), while y_train 1d (vector). In turn you get different sizes.

I think using X_train[:,0] for plotting (which is from where the error originates) should solve the problem

Leave a Comment