ageron / handson-ml

⛔️ DEPRECATED – See https://github.com/ageron/handson-ml3 instead.
Apache License 2.0
25.18k stars 12.92k forks source link

Chapter 2/median_house_value, Length: 16512, dtype: float64>, dtype=object) cannot be considered a valid collection. #602

Closed Al3xDo closed 3 years ago

Al3xDo commented 3 years ago

Hi everyone, I'm stuck in this error when i use `from sklearn.linear_model import LinearRegression

lin_reg= LinearRegression() lin_reg.fit(housing_prepared, housing_labels)` Here is the error log: 12 13

adityaparamesh commented 3 years ago

replace housing_labels = strat_train_set["median_house_value"].copy to housing_labels = strat_train_set["median_house_value"].copy() and that will fix it