Tidymodels: ...columns were requested but there were x predictors

What does this message mean?:

! Fold1: preprocessor 1/1, model 8/12: 99 columns were requested but there were 97 predictors in the data. 97 wil...


Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down that page.

#> Error in reprex(): could not find function "reprex"
Created on 2021-08-03 by the reprex package (v2.0.0)

#> i Non-interactive session, setting html_preview = FALSE.
#> CLIPR_ALLOW has not been set, so clipr will not run interactively
#> Error in switch(where, expr = stringify_expression(x_expr), clipboard = ingest_clipboard(), : EXPR must be a length 1 vector

Is the initial message probably coused by a divergence between vfold_cv() and recipe(), in their results, in regard to count of features/columns?

There's really no way to know without code and a small, reproducible example that we can execute.

Did someone else got this message- and in which context?

I think the answer is, that vfold_cv() indeed needs proceeded recipe data, when used in trainings e.g. tune_grid().

That is not the case. You should never need to resample the preprocessed data.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.