Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Limit to Cluster Sizing (Predictive Tools)

teharrell
5 - Atom

I had an idea for a spinoff of Weekly Challenge #199. The objective was to add carpooling, where a group of friends (determined by proximity) would meet to then determine the top three theaters to minimize total distance traveled. 

 

I achieved the grouping part of the problem using the K-Centroid Cluster Analysis tool, with three clusters (representing three cars). However, one of the clusters has a size of six, which would be fine if the vehicles had indeterminate passenger capacity. However, I would like to limit the clusters to a size of five, representative of a common sedan.

 

Is there a way to limit cluster size when using predictive grouping tools?

1 REPLY 1
acarter881
12 - Quasar

Hey, @teharrell. That's an interesting question. I looked in the K-Centroids Cluster Analysis tool and I can count (in this example) the number of records it is assigning to each cluster and which they belong to, but they're anonymized. The R code doesn't seem to have anything in it that would easily allow you to specify the minimum or maximum size of a cluster. I did find a GitHub repo that answers your question using Python. Here's another example of the Python code. Perhaps you can try using the Python tool in Alteryx to solve this. A relevant snippet is shown below.

 

acarter881_0-1666801442684.png

 

Labels
Top Solution Authors