Skip to content

Commit 48dc7a5

Browse files
updated getting started samples
1 parent 45e85ee commit 48dc7a5

File tree

5 files changed

+43
-16
lines changed

5 files changed

+43
-16
lines changed

samples/features/r-services/Getting-Started/Customer-Clustering/Customer Clustering.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
USE [tpcx1b]
1+
USE [tpcxbb_1gb]
22

33
DROP PROC IF EXISTS generate_customer_return_clusters;
44
GO

samples/features/r-services/Getting-Started/Customer-Clustering/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Build a predictive model with SQL Server R Services
1+
# Perform customer clustering with SQL Server R Services
22

3-
This sample provides custom reports for SQL Server R Services that can be viewed from SQL Server Management Studio. The reports can be used to view configuration information, resource usage, execution statistics, active sessions and other information about R Services.
3+
In this sample, we are going to get ourselves familiar with clustering.
4+
Clustering can be explained as organizing data into groups where members of a group are similar in some way.
45

56
### Contents
67

@@ -14,13 +15,12 @@ This sample provides custom reports for SQL Server R Services that can be viewed
1415

1516
## About this sample
1617

17-
Predictive modeling is a powerful way to add intelligence to your application. It enables applications to predict outcomes against new data.
18-
The act of incorporating predictive analytics into your applications involves two major phases:
19-
model training and model operationalization.
18+
We will be using the Kmeans algorithm to perform the clustering of customers. This can for example be used to target a specific group of customers for marketing efforts.
19+
Kmeans clustering is an unsupervised learning algorithm that tries to group data based on similarities. Unsupervised learning means that there is no outcome to be predicted, and the algorithm just tries to find patterns in the data.
2020

21-
In this sample, you will learn how to create a predictive model in R and operationalize it with SQL Server 2016.
21+
In this sample, you will learn how to perform Kmeans clustering in R and deploying the solution in SQL Server 2016.
2222

23-
Follow the step by step tutorial [here](http://aka.ms/sqldev/R) to walk through this sample.
23+
Follow the step by step tutorial [here](https://www.microsoft.com/en-us/sql-server/developer-get-started/rclustering) to walk through this sample.
2424

2525
<!-- Delete the ones that don't apply -->
2626
- **Applies to:** SQL Server 2016 (or higher)
@@ -35,7 +35,8 @@ Follow the step by step tutorial [here](http://aka.ms/sqldev/R) to walk through
3535
## Before you begin
3636

3737
To run this sample, you need the following prerequisites.
38-
Section 1 in the [tutorial](http://aka.ms/sqldev/R) covers all prerequisites.
38+
Section 1 in the [tutorial](https://www.microsoft.com/en-us/sql-server/developer-get-started/rclustering) covers the prerequisites.
39+
After that, you can download a DB backup file and restore it using Setup.sql. [Download DB](https://deve2e.azureedge.net/sqlchoice/static/tpcxbb_1gb.bak)
3940

4041
**Software prerequisites:**
4142

@@ -48,14 +49,13 @@ Section 1 in the [tutorial](http://aka.ms/sqldev/R) covers all prerequisites.
4849
<a name=sample-details></a>
4950
## Sample Details
5051

51-
### PredictiveModel.R
52+
### Customer Clustering.R
5253

53-
The R script that generates a predictive model and uses it to predict rental counts
54+
The R script that performs clustering.
5455

55-
### PredictiveModel.SQL
56-
57-
Takes the R code in PredictiveModel.R and uses it inside SQL Server. Creating stored procedures for training and prediction.
56+
### Customer Clustering.SQL
5857

58+
The SQL code to create stored procedure that performs clustering, and queries to verify and take further actions.
5959

6060

6161
<a name=related-links></a>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Before we start, we need to restore the DB for this tutorial.
2+
-- Step1: Download the compressed backup file
3+
-- Save the file on a location where SQL Server can access it. For example: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\
4+
-- In a new query window in SSMS, execute the following restore statement, but REMEMBER TO CHANGE THE FILE PATHS
5+
-- to match the directories of your installation!
6+
USE master;
7+
GO
8+
RESTORE DATABASE Tpcx1b
9+
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\Tpcx1b.bak'
10+
WITH
11+
MOVE 'Tpcx1b' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\Tpcx1b.mdf'
12+
,MOVE 'Tpcx1b_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\Tpcx1b.ldf';
13+
GO

samples/features/r-services/Getting-Started/Predictive-Modeling/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Build a predictive model with SQL Server R Services
22

3-
This sample provides custom reports for SQL Server R Services that can be viewed from SQL Server Management Studio. The reports can be used to view configuration information, resource usage, execution statistics, active sessions and other information about R Services.
3+
This sample shows how to create a predictive model in R and operationalize it with SQL Server 2016.
44

55
### Contents
66

@@ -35,7 +35,8 @@ Follow the step by step tutorial [here](http://aka.ms/sqldev/R) to walk through
3535
## Before you begin
3636

3737
To run this sample, you need the following prerequisites.
38-
Section 1 in the [tutorial](http://aka.ms/sqldev/R) covers all prerequisites.
38+
Section 1 in the [tutorial](http://aka.ms/sqldev/R) covers the prerequisites.
39+
After that, you can download a DB backup file and restore it using Setup.sql. [Download DB](https://deve2e.azureedge.net/sqlchoice/static/TutorialDB.bak)
3940

4041
**Software prerequisites:**
4142

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Before we start, we need to restore the DB for this tutorial.
2+
-- Step1: Download the compressed backup file (https://deve2e.azureedge.net/sqlchoice/static/TutorialDB.bak)
3+
--Save the file on a location where SQL Server can access it. For example: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\
4+
-- In a new query window in SSMS, execute the following restore statement, but REMEMBER TO CHANGE THE FILE PATHS
5+
-- to match the directories of your installation!
6+
USE master;
7+
GO
8+
RESTORE DATABASE TutorialDB
9+
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\TutorialDB.bak'
10+
WITH
11+
MOVE 'TutorialDB' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\TutorialDB.mdf'
12+
,MOVE 'TutorialDB_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\TutorialDB.ldf';
13+
GO

0 commit comments

Comments
 (0)