Apply R-based predictive model.

Parameters:

Parameters:
See dedicated page for more information.
R_ApplyModel2 loads one or more previously trained R models and scores any input table—no matter how it’s partitioned. Because models are read from files rather than re-fit in memory, you can score datasets that are much larger than available RAM. The action also supports opening many models at once in a single run, which is ideal when you maintain a library of models (e.g., GLM, Logistic Regression, C5/C50, CHAID/CRT trees, Naïve Bayes, XGBoost, Survival, PLS/Splines, etc.).
Typical uses:
A table to score. Any partitioning is accepted (row, column, by-column, or none).
Requirements
The input rows plus the scoring results. Depending on the model type, columns may include:
*.Class or *.Response – predicted class/response*.Prob_<class> – class probabilities (optional; only if enabled and supported by the model)*.Score / *.Risk – numeric scores when applicableModelName – the name of the model file used (helpful when scoring multiple models)(Exact column names vary by algorithm; R_ApplyModel2 keeps each model’s fields prefixed or suffixed to avoid clashes.)
| Parameter | What it is | Tips |
|---|---|---|
| idKey (Key variable) | The unique identifier column in your input table. | Pick the column you will join on (e.g., customer_id, row_id). |
| myModel (The R model to apply) | Where to load model files from. | Click the dropdown next to select type to choose: assets (bundled files), temporary data, recorded data (recommended; e.g., models produced earlier in the pipeline), JavaScript expression, or @shared source. Select one or many *.rModel files. |
| idxProb (Include probability per class?) | Adds per-class probabilities to the output when the model supports it. | Only meaningful for classification models (Logistic, Naïve Bayes, C5/C50, XGBoost-classifier, etc.). Leave off for regression models. |
📦 Model files
The training actions that create models (GLM,C50, XGBoost, etc.) typically emit*.rModel. Point myModel to these files (often via recorded data → records/out.rModel from the upstream training node).
Upstream: Train a model with one of the R training boxes and make sure it outputs a *.rModel file (default path is often records/out.rModel).
Connect data: Feed the table you want to score into R_ApplyModel2 (pin 1).
Set parameters:
row_id).records/out.rModel from the training node (you can pick multiple).Run.
The output table in Process → Data will show predictions (and probabilities if selected). You can also find the scored table under Records depending on your pipeline settings.
*.rModel files at once. R_ApplyModel2 will apply each model across the full dataset and append the corresponding outputs.churn_v2025_09_18.rModel) so you can reproduce runs and audits.“Model not found” or cannot open connection
Ensure myModel points to an existing *.rModel (e.g., via recorded data → records/out.rModel). If the training node didn’t write the file, enable its model output.
“Object … not found” or missing predictor columns
Add a prepare step to create/rename the missing columns to match training.
“Factor has new levels …”
Your scoring data contains unseen categories. Reuse the same encoding/mapping used in training (e.g., collapse rare labels, ensure identical factor level ordering).
R_ApplyModel2 is model-agnostic and can apply models produced by many R actions, including (but not limited to):
If an algorithm supports both class and probability outputs, idxProb gives you both the predicted class and per-class probability columns.
