tidymodels / hardhat

Construct Modeling Packages
https://hardhat.tidymodels.org
Other
103 stars 17 forks source link

forge(outcomes= TRUE) when using the XY method #28

Closed DavisVaughan closed 5 years ago

DavisVaughan commented 5 years ago

Since I add a default column name, .outcome, to y when it is converted to a tibble, I could just have forge() look for a column named .outcome to be there in new_data. This would require 0 extra effort on my part, it would do this already if I didn’t prematurely error out.

This would also allow the user to pass in a data frame for y (where you obviously know the column name for the outcome) and then request outcomes to be processed in forge(). (You currently can’t do this because that also goes through the XY method)

The only extra thing I would do is have a special check in place if forge(outcomes = TRUE) is requested, and the ".outcome" column doesn’t exist in new_data. It would make it very clear that the user passed a vector to y and that vector was given the name .outcome so that is what forge() is looking for.

DavisVaughan commented 5 years ago

Closed by #29

github-actions[bot] commented 3 years 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.