Memory issues with creating simple regression model

I solved this. It was because my y variable was a numpy array instead of a column vector.