ageron / ageron/handson-ml2

[QUESTION][2nd Chapter] LinearRegression() - Value Error

Open
#582 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
30k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

Hi sir, I have recently started reading your book and I'm in 2nd chapter now. till transformation pipeline I have got good knowledge and have implemented each line of code and practiced it as well.

But, coming to "Training and Evaluating on the Training Set" part, when I tried using linear regression an error is showing up by stating that "**ValueError: Found input variables with inconsistent numbers of samples: [16512, 4128]**"

```python
from sklearn.linear_model import LinearRegression

lin_reg = LinearRegression()
lin_reg.fit(housing_prepared, housing_labels)
```

I'm not getting this issue
and I'm stuck here, hope to hear back from you soon sir, Thank you

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.