I'm building a custom xgBoost parsnip model and I'm hoping to use fields that are not included in the predictors or outcome to create a watchlist. Is it possible to pass other fields through to the model function?
Backstory:
I often build models to make annual predictions on cohorts of students and typically include several past cohorts in the training data with a sliding window of testing data based on cohort to be sure that the model is tested on data that is closer to the actual data that will be used to generate the predictions. This is easy enough to accomplish within the cross-validation resamples, but it seems as though the model would perform better if the validation data within the xgBoost fit was also a more recent cohort rather than a random sample across all the training data (as is the case with the validation argument as currently implemented in Parsnip's xgBoost model. I think the best way to do this would be to pass criteria into the model function so the data could be split for each resample, but the criteria would be based on the cohort field, which isn't one of the predictors.