Closed erincperry closed 4 years ago
Can you send your recipe code?
wage_rec <- recipe(wage ~ age, health_ins, jobclass, education, race, data = Wage) %>% step_ns(age, deg_free = tune()) wage_rec
Looks like a type (,
should be +
)
wage_rec <- recipe(wage ~ age + health_ins + jobclass + education +race, data = Wage) %>%
step_ns(age, deg_free = tune())
wage_rec
Thank you! I changed to the plus signs, but I am still getting the same error when I run the last code. Is there anything else I should try?
Ahh I see it 👀 the problem is actually here:
tuning %>%
collect_metrics() %>%
filter(.metric == "deg_free") %>%
arrange(mean())
the filter
line is filtering the .metric
column. This column has two potential values rmse
or rsq
, you want to use rmse
so that is what you should filter based on (not "deg_free"
)
oh okay perfect! I will try that. Thank you!
Hi Dr. McGowan, I have got my degrees of freedom as well as rmse, but do we need to do the "final_spec" just like we did in lab 4?
Nope, you can skip that step!
@LucyMcGowan I'm also having trouble getting my code to run for this exercise. My code looks a little different from Erin's, but I think the error message that I'm receiving is similar. Do you have any pointers on how to fix mine? Do I need to create an object "grid" and add in a fit_resamples line like above?
@LucyMcGowan In case it's helpful, this is my recipe code!
There’s a small typo (step_ns()
should be for age not wage)
@LucyMcGowan Thank you so much!
@LucyMcGowan I am unable to get my code for the exercise 4 to run This is what I have so far:
The error says x Fold01: recipe: Error in df - 1L: non-numeric argument to ... x Fold02: recipe: Error in df - 1L: non-numeric argument to ... x Fold03: recipe: Error in df - 1L: non-numeric argument to ...
Do you have any advice / suggestions on how to fix this?