title: In building a predictive model in R, does using step_normalize function (tidymodels) require test data to be processed in the same way?
body: <p>I'm sorry if this is is the wrong place to ask this question. I'm confused about part of the <a href="https://www.tidymodels.org/" rel="nofollow noreferrer">tidymodels</a> functionality.  If I have a dataset (in the below example <code>ion_train</code>) and I apply the function <a href="https://recipes.tidymodels.org/reference/step_normalize.html" rel="nofollow noreferrer">step_normalize</a> to all predictors in the recipe to build an SVM, that will normalise numeric data to have a standard deviation of one and a mean of zero.  Does that mean that when I apply my SVM to a test dataset (in the below example <code>ion_test</code>), that I first need to scale that test dataset to have a standard deviation of one and a mean of zero before I use the <code>predict()</code> function (at the bottom of the code below)?</p>
  <pre><code>library(tidymodels)
  library(mlbench)
  data(Ionosphere)
  
  # preprocess dataset
  Ionosphere &lt;- Ionosphere %&gt;% select(-V1, -V2)
  
  # split into training and test data
  ion_split &lt;- initial_split(Ionosphere, prop = 3/5)
  
  ion_train &lt;- training(ion_split)
  ion_test &lt;- testing(ion_split) 
  
  # make a recipe
  iono_rec &lt;-
    recipe(Class ~ ., data = ion_train)  %&gt;%
    step_normalize(all_predictors()) 
  
  # build the model and workflow
  svm_mod &lt;-
    svm_rbf(cost = tune(), rbf_sigma = tune()) %&gt;%
    set_mode(&quot;classification&quot;) %&gt;%
    set_engine(&quot;kernlab&quot;)
  
  svm_workflow &lt;- 
        workflow() %&gt;%
        add_recipe(iono_rec) %&gt;%
        add_model(svm_mod)
  
  # run model tuning
  set.seed(35)
  recipe_res &lt;-
    svm_workflow %&gt;% 
    tune_grid(
      resamples = bootstraps(ion_train, times = 2),
      metrics = metric_set(roc_auc),
      control = control_grid(verbose = TRUE, save_pred = TRUE)
    )
  
  # chose best model, finalise workflow
  best_mod &lt;- recipe_res %&gt;% select_best(&quot;roc_auc&quot;)
  final_wf &lt;- finalize_workflow(svm_workflow, best_mod)
  final_mod &lt;- final_wf %&gt;% fit(ion_train)
  
  predict_res &lt;- predict(
          final_mod,
          ion_test,
          type = &quot;prob&quot;)
  </code></pre>