tidymodels / TMwR

Code and content for "Tidy Modeling with R"
https://tmwr.org
Other
579 stars 272 forks source link

Code Broken Ch 10 #374

Closed biscotty666 closed 3 months ago

biscotty666 commented 3 months ago

In 10.1, estimate_perf(lm_fit, ames_train) fails with

! Can't subset columns that don't exist.
✖ Columns `Gr_Liv_Area`, `Bldg_Type_TwoFmCon`, `Bldg_Type_Duplex`, `Bldg_Type_Twnhs`, and `Bldg_Type_TwnhsE` don't exist.

Running the code in 8.8 solves the problem.

Thank you for the wonderful book.

davidrsch commented 3 months ago

It doesn't fail per se, because as stated previously to the example:

"Let’s again use the Ames housing data to demonstrate these concepts. Section 8.8 summarizes the current state of our Ames analysis."

It is using the data resulting from Section 8.8.

And when rendering the chapter, it's ensure that this data will be available when calling in the source code:

source("ames_snippets.R")
load("RData/lm_fit.RData")
biscotty666 commented 3 months ago

It was just an fyi. I ran the code with the snippets and data file from the repo, indeed with a full clone of the repo. It's not a problem for me but I just thought you might want to know the code in the repo didn't run cleanly. Indeed, for someone just reading and following the book and the instructions it doesn't matter.​

Cheers

On May 16, 2024, 00:29, at 00:29, David @.***> wrote:

It doesn't fail per se, because as stated previously to the example:

"Let’s again use the Ames housing data to demonstrate these concepts. Section 8.8 summarizes the current state of our Ames analysis."

It is using the data resulting from Section 8.8.

And when rendering the chapter, it's ensure that this data will be available in the source code when calling

source("ames_snippets.R")
load("RData/lm_fit.RData")

-- Reply to this email directly or view it on GitHub: https://github.com/tidymodels/TMwR/issues/374#issuecomment-2114129398 You are receiving this because you authored the thread.

Message ID: @.***>

juliasilge commented 3 months ago

Thanks, @biscotty666 and @davidrsch! We don't consider this broken code but in fact as designed. Throughout the book, there are summaries at the end of the chapters of where we are in the analysis and then we refer to them in later chapters, like @davidrsch pointed out. There would be too much repeated code otherwise for the reader, in our option.

Thanks again!

biscotty666 commented 3 months ago

I'm so grateful that you provide this for free. It's really top-notch.

⁣Get BlueMail for Android ​

On May 16, 2024, 11:39, at 11:39, Julia Silge @.***> wrote:

Thanks, @biscotty666 and @davidrsch! We don't consider this broken code but in fact as designed. Throughout the book, there are summaries at the end of the chapters of where we are in the analysis and then we refer to them in later chapters, like @davidrsch pointed out. There would be too much repeated code otherwise for the reader, in our option.

Thanks again!

-- Reply to this email directly or view it on GitHub: https://github.com/tidymodels/TMwR/issues/374#issuecomment-2115841467 You are receiving this because you were mentioned.

Message ID: @.***>

github-actions[bot] commented 3 months ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.