title: How can I tune the minority_prop argument of the ROSE upsampling algorithm using tidymodels?
body: <p>I have an imbalanced data set and am using the tidymodels framework to build predictive models. To correct for the imbalance, I use the upsampling ROSE algorithm, which has two arguments I'd like to tune, namely <code>over_ratio</code> and <code>minority_prop</code>.</p>
  <p>To do so, I specified in the step recipe that each argument <code>=tune()</code>and then I built a CV grid with the corresponding names. However, the <code>minority_pro</code> argument is not recognized when I run the CV search.</p>
  <pre><code># data
  set.seed(20)
  y &lt;- rbinom(100, 1, 0.1)
  X &lt;- MASS::mvrnorm(100, c(1,2), diag(2))
  dat &lt;- cbind(y,X)
  dat &lt;- data.frame(dat)
  dat$y &lt;- as.factor(dat$y)
  
  
  # define the recipe
  my_recipe &lt;- 
    recipe(y ~ ., data = dat) |&gt; 
    step_rose(y, over_ratio = tune(), minority_prop = tune(),
              skip = TRUE) %&gt;% 
    step_normalize(all_numeric_predictors(), skip = FALSE)  
    
  
  # MODEL
  mod &lt;- 
    svm_rbf(mode = &quot;classification&quot;, cost = tune(),
            rbf_sigma = tune()) %&gt;% 
    set_engine(&quot;kernlab&quot;) 
  
  
  # set the workflow
  svc_workflow &lt;- workflow() %&gt;%
    # add the recipe
    add_recipe(my_recipe) %&gt;%
    # add the model
    add_model(mod)
  
  
  grid_svc &lt;- expand.grid(rbf_sigma = seq(0, 10, 2), cost = seq(0,10,2),
                          over_ratio = seq(0.5,1.5,0.5), minority_prop = seq(0.5,0.8,0.15))
  
  
  # cv tuning
  doParallel::registerDoParallel()
  cv_tuning &lt;- tune_grid(svc_workflow,
                         resamples = vfold_cv(dat),
                         grid = grid_svc,
                         metrics = metric_set(f_meas, precision, recall,
                                              accuracy, pr_auc))
  
  </code></pre>
  <p>I then receive the following error.</p>
  <pre><code>Error in `check_grid()`:
  ! The provided `grid` has the following parameter columns that have not been marked for tuning by `tune()`: 'minority_prop'.
  Run `rlang::last_error()` to see where the error occurred.
  </code></pre>
  <p>I tried tuning only over <code>over_ratio</code> without <code>minority_prop</code> and it worked. What am I doing wrong?</p>