Before continuing to the next steps, please follow the Prerequisite - Prepare the data section.
Integrating the R model for fast batch prediction
Step 1 – Train and save a real-time scoring model using T-SQL
In this step, you can create a predictive model for real-time scoring and native scoring, and optionally for the AUC, into a table via a stored procedure. The goal is to build a model that is reusable. You can skip this step if there is an existing compatible model that was created and stored in a table in SQL Server already.
The following stored procedure uses rxSerializeModel, which lets you serialize an R model in raw format. This then allows you to save the model in the VARBINARY format, which can be loaded...