Question No: 5

I copied the same code provided as the answer. but the accuracy score obtained by 5-fold cross-validation of this pipeline is not 0.9 .

Also I have a doubt, Is it OK to use logistic regression for the regression task (House Salesprice predixtion(Here) ).

In your first cell you missed the last line of code:

import pandas as pd
ames_housing = pd.read_csv("../datasets/house_prices.csv", na_values="?")
ames_housing = ames_housing.drop(columns="Id")

target_name = "SalePrice"
data, target = ames_housing.drop(columns=target_name), ames_housing[target_name]
target = (target > 200_000).astype(int)
1 Like

In addition to the answer of @ThomasLoock, you are tackling a regression problem then instead of the classification problem. The last line is transforming the regression problem into a classification problem because we did not see any regression problem at this stage of the course.

1 Like