X has 290 features, but LinearRegression is expecting 869 features as input.
for i in range(4,34,1):
HP_model = HP_model.fit(x_train, y_train)
# i copy this code from my old note book but some how it is an eror. My teacher have never seen this eror before too
Thank you for reaching out!
Unfortunately, I don't have access to the
df1 DataFrame and can't reproduce your results. However, such an error occurs when there is a mismatch in the dimensions of the training and testing dataset - you have trained your model on 869 features but are testing it on 290 features. Make sure that
x_test have the same dimensions during all iterations.