Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store cluster membership #75

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

xmacex
Copy link

@xmacex xmacex commented Jul 5, 2019

Ok amends the plot_data.json file with k-means clustering. The status quo master branch calculates a clustering to select hotspot images for human consuption on the web UI. With this both the membership for the centroids as centroids/members, as well as the labels are retained as the fifth list element for each of the images under positions in the output file.

So from

{
    "centroids" : [
	{
            "label" : "Cluster 1",
            "img" : "img_021_Brazil_pt_global_warming.jpg"
	},
	{
            "label" : "Cluster 2",
            "img" : "img_125_Brazil_pt_global_warming.jpg",
	}
    ],
   "positions" : [
      ["img_124_Brazil_pt_climate_change_mitigation", -785, 740, 32, 24],
      ["img_078_Brazil_pt_climate_change", -456, -94, 32, 22],
      ["img_022_Brazil_pt_global_warming", -380, 349, 32, 26],
      ["img_219_Brazil_pt_climate_change_adaptation", -735, 746, 32, 24]
    ]
}

To

{
    "centroids" : [
	{
            "label" : "Cluster 1",
            "img" : "img_021_Brazil_pt_global_warming.jpg",
            "members" : [89, 124, 297, 312, 440]
	},
	{
            "label" : "Cluster 2",
            "img" : "img_125_Brazil_pt_global_warming.jpg",
            "members" : [13, 40, 51, 55, 81, 83, 109, 191]
	}
    ],
   "positions" : [
      ["img_124_Brazil_pt_climate_change_mitigation", -785, 740, 32, 24, 1],
      ["img_078_Brazil_pt_climate_change", -456, -94, 32, 22, 2],
      ["img_022_Brazil_pt_global_warming", -380, 349, 32, 26, 2],
      ["img_219_Brazil_pt_climate_change_adaptation", -735, 746, 32, 24, 1]
    ]
}

You get the idea, I hope.

Here's a colouring, with k=20, produced outside of the web UI.

Brazil k-means clustering with k=20

The solution needs validation. From let's say engineering and software design point and it would be nice to confidently say this PR doesn't break anything, e.g. the JSON file parsing by the visualization data load or something. From design or research tooling point of view it is worth asking whether making available a discrete cluster membership is a good idea for working forward from the plot_data.json, because it is a certain violence done on the more topological, more continuous space which we are working with here.

Closes #74.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clustering is calculated, but discarded
1 participant