Perform customer clustering with SQL Server R Services
In this sample, we are going to get ourselves familiar with clustering. Clustering can be explained as organizing data into groups where members of a group are similar in some way.
About this sample
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. 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.
In this sample, you will learn how to perform Kmeans clustering in R and deploying the solution in 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
- SQL Server 2016 (or higher) with R Services installed
- SQL Server Management Studio
- R IDE Tool like Visual Studio
The R script that performs clustering.
The SQL code to create stored procedure that performs clustering, and queries to verify and take further actions.
For additional content, see these articles: