The dataset which I am using consists of 100 entries indicating the rent price of the house at a different location.
After completing training, I have sent the training data as test data, but when I check the results I am getting an incorrect answer.
X_loc = df[{'area','rooms','location'}]
y_loc = df[:]['price']
X_train, X_test, y_train, y_test = train_test_split(X_loc, y_loc, test_size = 1/3, random_state = 0)
regressor = LinearRegression()
regressor.fit(X_train, y_train) y_pred = regressor.predict(X_train[0:1])
Dataset which I am using is:
price rooms area location
0 0 22000 3 1339 140
1 1 45000 3 1580 72
3 3 72000 3 2310 72
4 4 40000 3 1800 41
5 5 35000 3 2100 57
The expected output of y_predict has to be 220000 but I am getting the result as 290000, how can it be possible?