Merge pull request #176 from NelGson/master

Update to Clustering.sql file
This commit is contained in:
Umachandar Jayachandran
2017-01-31 18:03:55 -08:00
committed by GitHub
2 changed files with 3 additions and 4 deletions
@@ -64,7 +64,7 @@ plot(1:20, wss, type = "b", xlab = "Number of Clusters", ylab = "Within groups s
# Output table to hold the customer group mappings
return_cluster = RxSqlServerData(table = "return_cluster", connectionString = connStr);
# Set.seed for random number generator for predicatability
# Set.seed for random number generator for predictability
set.seed(10);
# Generate clusters using rxKmeans and output key / cluster to a table in SQL Server called return_cluster
@@ -10,7 +10,6 @@ AS
*/
BEGIN
DECLARE @duration FLOAT
, @predict_duration FLOAT
, @instance_name NVARCHAR(100) = @@SERVERNAME
, @database_name NVARCHAR(128) = db_name()
@@ -66,7 +65,7 @@ customer_returns <- RxSqlServerData(sqlQuery = input_query,
# Output table to hold the customer cluster mappings
return_cluster = RxSqlServerData(table = "customer_return_clusters", connectionString = connStr);
# set.seed for random number generator for predicatability
# set.seed for random number generator for predictability
set.seed(10);
# generate clusters using rxKmeans and output clusters to a table called "customer_return_clusters".
@@ -99,4 +98,4 @@ SELECT customer.[c_email_address], customer.c_customer_sk
JOIN
[dbo].[customer_return_clusters] as r
ON r.customer = customer.c_customer_sk
WHERE r.cluster = 1
WHERE r.cluster = 3