joelgrus / data-science-from-scratch

code for Data Science From Scratch book
MIT License
8.71k stars 4.52k forks source link

inputs of Chapter 15. Multiple Regression - Fitting the Model #72

Closed dkreeft closed 5 years ago

dkreeft commented 5 years ago

In Chapter 15, section "Fitting the Model" tried is to estimate beta using the following line of code from the book:

beta = least_squares_fit(inputs, daily_minutes_good, learning_rate, 5000, 25)

However, I cannot seem to find inputs that is used, other than the following: https://github.com/joelgrus/data-science-from-scratch/blob/0c2442e7e823f7e731635d124e8c685af320d859/scratch/gradient_descent.py#L39

But that is obviously not going to work, because the above line of code does not generate enough columns (2 vs. required 4 for this model). Am I missing something? inputs is also used further in the chapter.

joelgrus commented 5 years ago

the values are in the file for that chapter:

https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/multiple_regression.py#L4

but you're right that the book doesn't really make that clear. let me think on that.