tidymodels / tidymodels/workflows
Support for eval(validation) data
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 211
- Forks
- 26
- Avg merge
- 1h 58m
- Merged PRs (30d)
- 1
Description
The following problem arose where one of the preprocessing steps was embed:: step_lencode_glm (generalized target encoding) and model was xgboost.
From the documentation of parsnip::xgb_train it appears that evaluation data cannot be used for early stopping. While the argument validation sets aside some validation(eval) data for early stopping, its not clear if recipe is applied after splitting train and validation parts. How does this work?
It might be a good idea to support something like this:
# case 1: User specifies train and eval
workflow() %>%
add_recipe(some_recipe) %>%
add_model(some_model) %>%
fit(train_data = A, eval_data = B, use_eval_in_early_stopping = TRUE)
# case 2: Use the existing 'initial_split' class object
splitter = initial_split(dataset, 0.7)
workflow() %>%
add_recipe(some_recipe) %>%
add_model(some_model) %>%
fit(splitter, use_eval_in_early_stopping = TRUE)
where
- a recipe is always trained on the train part and baked on the eval(validation) part
- eval data to be used in early stopping if the algorithm supports it and the flag is set to true.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the parsnip::xgb_train documentation and the workflow(), fit(), and initial_split() entry points mentioned in the issue. Trace how recipes would be trained on the training split and baked on evaluation data, including the requested early-stopping behavior. Done should define and verify an API for supplied or split evaluation data when the model supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100