Interpreting the results

Now we can take a look at how the points were assigned:

julia> result.assignments 
28-element Array{Int64,1}: 
 3 
 3 
 3 
 1 
 1 
 # some 1 values omitted from the output for brevity 
 1 
 1 
 2 
 2 
 # some 2 values omitted from the output for brevity 
 2 
 2 

Each element in the array corresponds to the element at the same index in the model_data. Let's combine the data so it's easier to follow:

julia> model_data[:cluster_id] = result.assignments 
28-element Array{Int64,1}: # output truncated #

Now let's see what we end up with:

julia> model_data

The output is as follows:

We can see that the first three zip codes have been assigned to cluster ...

Get Julia Programming Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.