mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Merge pull request #176 from NelGson/master
Update to Clustering.sql file
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+2
-3
@@ -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
|
||||
Reference in New Issue
Block a user