1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/features/r-services/getting-started/predictive-modeling
2017-02-02 13:56:24 -08:00
..
2017-02-02 13:56:24 -08:00
2017-02-02 13:56:24 -08:00

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:

  1. SQL Server 2016 (or higher) with R Services installed
  2. SQL Server Management Studio
  3. 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.

For additional content, see these articles:

SQL Server R Services - Upgrade and Installation FAQ

Other SQL Server R Services Tutorials