Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Cluster Analysis - Distance from k-centroid to each member of the cluster?

ggruccio
13 - Pulsar
13 - Pulsar

I've run cluster analyses a number of times, but have never been asked this before....so I did some digging and could not find anything in the Alteryx toolset or on community that would help me answer it. 

 

I understand how to run a cluster analysis and then append clusters with the tools shown below...I can see the average distance within cluster in the typical output.  But how to get the distance from each of the k-centroids to each of the members of each cluster?  For context I had grouped some store locations, and then someone asked me which stores are in the center of each cluster and which ones on the fringe.

ggruccio_0-1615473784110.pngggruccio_1-1615473831810.png

6 REPLIES 6
StephenR
Alteryx
Alteryx

Hello @ggruccio I would recommend using the Poly-Build Tool to build a convex hull polygon, then we can use the Spatial Info tool to get the geographically weighted center. This allows us to use the Distance Tool to get distances from center.

Regards,
Stephen Ruhl
Customer Support Engineer

ggruccio
13 - Pulsar
13 - Pulsar

HI @StephenR,

 

Thank you and I think that would work if I had done the cluster analysis based on latitude/longitude or spatial position.  However this is based on various factors including demographics, store performance, competitive factors etc.  Is there a way to get the relative 'coordinates' for each observation based on these factors?  Thanks!

StephenR
Alteryx
Alteryx

@ggruccio Thank you for explaining that. The K - Centroids Cluster Analysis tool actually outputs cluster centroids. There are Two fields in the O Output: grp and out. There are a few headers, but if you filter on the Clus_Centers value for the grp field, then you should get a pipe delineated list of cluster centers for each parameter. There is also Clus_Info which gives some stats about the cluster itself. With that and the output of the Append Cluster tool, you should be able to get a lot of insight.

Regards,
Stephen Ruhl
Customer Support Engineer

ianwi
Moderator
Moderator

Hi @ggruccio,

 

The Find Nearest Neighbors tool may provide what you're looking for. You'll need to grab the cluster assignments to link them with your store locations but you can find the "distance" between them. Also, including the Interactive Lesson in case you want more info!

 

Hope that helps!

ggruccio
13 - Pulsar
13 - Pulsar

Will give both a try.  Stay Tuned!

ggruccio
13 - Pulsar
13 - Pulsar

Thank you @ianwi  - this did for me what I was looking to do!  Already found another use case for it.

Labels