0

why y_test[0] works fine here

from sklearn.linear_model import LinearRegression

lr = LinearRegression()
lr.fit(X_train, y_train)
predictions = lr.predict(X_test)

print("Actual value of the house:- ", y_test[0]) 
print("Model Predicted Value:- ", predictions[0])

but y_test[1] can't.

here shape of y_test shape is (102,)

so by the array logic it should give me value upto 102.

y_test[0] y_test[1] . . . . . y_test[102]

but only y_test[0] works.

I thought y_test[1] should work the same as y_test[0] but something is wrong with that idk what. what does y_test[0] means exactly?

0 Answers0