This technical note explains how to create a cluster analysis report in Strategy Enterprise Manager 9.x.
The out-of-the-box sample report is included in the Tutorial Project under \Public Objects\Reports\Strategy Platform Capabilities\Strategy Data Mining Services\Cluster Analysis. The segmentation is seen in a report and the result of the model is seen in the predictive view model in a graphical way as shown in the image below. The K-Means algorithm is used in the predictive metric.


User may want to use hierarchical clustering approaches. The following steps show how to create a hierarchical cluster report using R with the Tutorial Project.
#Get the data
if(exists("mstr.ExFlag")) {
#If this is executed by Strategy
df <- data.frame(cbind(col0, col1, col2, col3, col4, col5))# data frame from the input variables
rownames(df) <- df[, 1] # Input row name from the first column
df2 <- df[ ,-1] # Delete the first column.
rownames(df2) <- rownames(df) # Set the row name
} else {
#If this is NOT via a Strategy Report Execution
df<- matrix(c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4), nrow=4, ncol=4)
rownames(df)<-c("A","B","C","D")
numofclusters="5"
}
#Modeling
model <- dist(df2) # distance matrix
cluster <- hclust(model, method="complete") #complete linkage
cluster.k <- cutree(cluster, k=numofclusters) # cut tree into the number of clusters
png("../Images/hc.png") # the device to save a png image
plot(cluster) # draw dendogram
dev.off() # close the device

#RVAR numofcluster -parameter StringParam9



