Build a predictive model with SQL Server R Services
This sample shows how to create a predictive model in R and operationalize it with SQL Server 2016.
Contents
About this sample
Before you begin
Sample details
Related links
About this sample
Predictive modeling is a powerful way to add intelligence to your application. It enables applications to predict outcomes against new data. The act of incorporating predictive analytics into your applications involves two major phases: model training and model operationalization.
In this sample, you will learn how to create a predictive model in R and operationalize it with SQL Server 2016.
Follow the step by step tutorial here to walk through this sample.
- Applies to: SQL Server 2016 (or higher)
- Key features:
- Workload: SQL Server R Services
- Programming Language: T-SQL, R
- Authors: Nellie Gustafsson
- Update history: Getting started tutorial for R Services
Before you begin
To run this sample, you need the following prerequisites. Section 1 in the tutorial covers the prerequisites. After that, you can download a DB backup file and restore it using Setup.sql. Download DB
Software prerequisites:
- SQL Server 2016 (or higher) with R Services installed
- SQL Server Management Studio
- R IDE Tool like Visual Studio
Sample Details
PredictiveModel.R
The R script that generates a predictive model and uses it to predict rental counts
PredictiveModel.SQL
Takes the R code in PredictiveModel.R and uses it inside SQL Server. Creating stored procedures for training and prediction.
Related Links
For additional content, see these articles: